summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfahim2015-06-02 11:41:46 +0530
committerfahim2015-06-02 11:41:46 +0530
commit5357a0cebc493f1fd5e6c232af77269b9b03abd8 (patch)
tree8773a8d8e201deaa2d8f41e4d41abc47f59d1b84
parentb55f693aae4b4874e89514b83d59f5566f8d3998 (diff)
downloadeSim-5357a0cebc493f1fd5e6c232af77269b9b03abd8.tar.gz
eSim-5357a0cebc493f1fd5e6c232af77269b9b03abd8.tar.bz2
eSim-5357a0cebc493f1fd5e6c232af77269b9b03abd8.zip
Subject: CSS changes
Description: CSS changes
-rwxr-xr-xsrc/frontEnd/Application.py12
-rw-r--r--src/frontEnd/DockArea.py24
-rw-r--r--src/frontEnd/ProjectExplorer.py16
-rwxr-xr-xsrc/images/branch-closed.pngbin0 -> 334 bytes
-rwxr-xr-xsrc/images/branch-end.pngbin0 -> 182 bytes
-rwxr-xr-xsrc/images/branch-more.pngbin0 -> 136 bytes
-rwxr-xr-xsrc/images/branch-open.pngbin0 -> 346 bytes
-rw-r--r--src/kicadtoNgspice/DeviceModel.py83
-rw-r--r--src/kicadtoNgspice/Model.py27
9 files changed, 128 insertions, 34 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index ca9471c6..10ee598f 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -30,7 +30,7 @@ import os
import sys
import time
import shutil
-
+from PyQt4.Qt import QSize
class Application(QtGui.QMainWindow):
"""
@@ -119,6 +119,8 @@ class Application(QtGui.QMainWindow):
self.lefttoolbar.addAction(self.pcb)
self.lefttoolbar.addAction(self.model)
self.lefttoolbar.setOrientation(QtCore.Qt.Vertical)
+ self.lefttoolbar.setIconSize(QSize(40,40))
+
def new_project(self):
"""
@@ -235,7 +237,13 @@ class MainView(QtGui.QWidget):
#Area to be included in MainView
self.noteArea = QtGui.QTextEdit()
- self.obj_dockarea = DockArea.DockArea()
+ #CSS
+
+ self.noteArea.setStyleSheet(" \
+ QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px; } \
+ ")
+
+ self.obj_dockarea = DockArea.DockArea()
self.obj_projectExplorer = ProjectExplorer.ProjectExplorer()
#Adding content to vertical middle Split.
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
index 76216aa6..4e4f038c 100644
--- a/src/frontEnd/DockArea.py
+++ b/src/frontEnd/DockArea.py
@@ -19,7 +19,10 @@ class DockArea(QtGui.QMainWindow):
for dockName in dockList:
dock[dockName] = QtGui.QDockWidget(dockName)
dock[dockName].setWidget(QtGui.QTextEdit())
-
+ #CSS
+ dock[dockName].setStyleSheet(" \
+ QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px; width: 200px; height: 150px; } \
+ ")
self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock[dockName])
#self.tabifyDockWidget(dock['Notes'],dock['Blank'])
@@ -44,6 +47,13 @@ class DockArea(QtGui.QMainWindow):
self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Tips-'+str(count)])
self.tabifyDockWidget(dock['Welcome'],dock['Tips-'+str(count)])
+ """
+ #CSS
+ dock['Tips-'+str(count)].setStyleSheet(" \
+ QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px; width: 200px; height: 150px; } \
+ ")
+ """
+
dock['Tips-'+str(count)].setVisible(True)
dock['Tips-'+str(count)].setFocus()
dock['Tips-'+str(count)].raise_()
@@ -72,6 +82,12 @@ class DockArea(QtGui.QMainWindow):
self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Plotting-'+str(count)])
self.tabifyDockWidget(dock['Welcome'],dock['Plotting-'+str(count)])
+ """
+ #CSS
+ dock['Plotting-'+str(count)].setStyleSheet(" \
+ QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px; width: 200px; height: 150px; } \
+ ")
+ """
dock['Plotting-'+str(count)].setVisible(True)
dock['Plotting-'+str(count)].setFocus()
dock['Plotting-'+str(count)].raise_()
@@ -103,6 +119,12 @@ class DockArea(QtGui.QMainWindow):
self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['NgSpice-'+str(count)])
self.tabifyDockWidget(dock['Welcome'],dock['NgSpice-'+str(count)])
+ """
+ #CSS
+ dock['NgSpice-'+str(count)].setStyleSheet(" \
+ QWidget { border-radius: 15px; border: 1px solid gray; padding: 0px; width: 200px; height: 150px; } \
+ ")
+ """
dock['NgSpice-'+str(count)].setVisible(True)
dock['NgSpice-'+str(count)].setFocus()
dock['NgSpice-'+str(count)].raise_()
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index 8d91dc6c..d98c5d15 100644
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -14,6 +14,18 @@ class ProjectExplorer(QtGui.QWidget):
self.treewidget.setHeaderItem(header)
self.treewidget.setColumnHidden(1,True)
+ #CSS
+ self.treewidget.setStyleSheet(" \
+ QTreeView { border-radius: 15px; border: 1px solid gray; padding: 5px; width: 200px; height: 150px; } \
+ QTreeView::branch:has-siblings:!adjoins-item { border-image: url(../images/vline.png) 0; } \
+ QTreeView::branch:has-siblings:adjoins-item { border-image: url(../images/branch-more.png) 0; } \
+ QTreeView::branch:!has-children:!has-siblings:adjoins-item { border-image: url(../images/branch-end.png) 0; } \
+ QTreeView::branch:has-children:!has-siblings:closed, \
+ QTreeView::branch:closed:has-children:has-siblings { border-image: none; image: url(../images/branch-closed.png); } \
+ QTreeView::branch:open:has-children:!has-siblings, \
+ QTreeView::branch:open:has-children:has-siblings { border-image: none; image: url(../images/branch-open.png); } \
+ ")
+
for parents, children in self.obj_appconfig.project_explorer.items():
os.path.join(parents)
if os.path.exists(parents):
@@ -96,7 +108,9 @@ class ProjectExplorer(QtGui.QWidget):
def save_data(self):
self.fopen=open(self.filePath, 'w')
- self.fopen.write(self.text.toPlainText())
+ lines = str(self.text.toPlainText()).split('\n')
+ lines=[i+'\r' for i in lines]
+ self.fopen.writelines(lines)
self.fopen.close()
self.textwindow.close()
diff --git a/src/images/branch-closed.png b/src/images/branch-closed.png
new file mode 100755
index 00000000..213ffdd8
--- /dev/null
+++ b/src/images/branch-closed.png
Binary files differ
diff --git a/src/images/branch-end.png b/src/images/branch-end.png
new file mode 100755
index 00000000..54915b3b
--- /dev/null
+++ b/src/images/branch-end.png
Binary files differ
diff --git a/src/images/branch-more.png b/src/images/branch-more.png
new file mode 100755
index 00000000..664ad447
--- /dev/null
+++ b/src/images/branch-more.png
Binary files differ
diff --git a/src/images/branch-open.png b/src/images/branch-open.png
new file mode 100755
index 00000000..e8cad95c
--- /dev/null
+++ b/src/images/branch-open.png
Binary files differ
diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py
index eaae2fbb..4866437a 100644
--- a/src/kicadtoNgspice/DeviceModel.py
+++ b/src/kicadtoNgspice/DeviceModel.py
@@ -37,15 +37,25 @@ class DeviceModel(QtGui.QWidget):
words = eachline.split()
if eachline[0] == 'q':
print "Words ",words[0]
- self.label = QtGui.QLabel("Add library for Transistor "+words[0]+" : "+words[4])
- self.grid.addWidget(self.label,self.row,0)
+ transbox=QtGui.QGroupBox()
+ transgrid=QtGui.QGridLayout()
+ transbox.setTitle("Add library for Transistor "+words[0]+" : "+words[4])
self.entry_var[self.count] = QtGui.QLineEdit()
self.entry_var[self.count].setText("")
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ transgrid.addWidget(self.entry_var[self.count],self.row,1)
self.addbtn = QtGui.QPushButton("Add")
self.addbtn.setObjectName("%d" %self.count)
self.addbtn.clicked.connect(self.trackLibrary)
- self.grid.addWidget(self.addbtn,self.row,2)
+ transgrid.addWidget(self.addbtn,self.row,2)
+ transbox.setLayout(transgrid)
+
+ #CSS
+ transbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(transbox)
#Adding Device Details
self.deviceDetail[self.count] = words[0]
@@ -56,15 +66,25 @@ class DeviceModel(QtGui.QWidget):
elif eachline[0] == 'd':
print "Words",words[0]
- self.label = QtGui.QLabel("Add library for Diode "+words[0]+" : "+words[3])
- self.grid.addWidget(self.label,self.row,0)
+ diodebox=QtGui.QGroupBox()
+ diodegrid=QtGui.QGridLayout()
+ diodebox.setTitle("Add library for Diode "+words[0]+" : "+words[3])
self.entry_var[self.count] = QtGui.QLineEdit()
self.entry_var[self.count].setText("")
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ diodegrid.addWidget(self.entry_var[self.count],self.row,1)
self.addbtn = QtGui.QPushButton("Add")
self.addbtn.setObjectName("%d" %self.count)
self.addbtn.clicked.connect(self.trackLibrary)
- self.grid.addWidget(self.addbtn,self.row,2)
+ diodegrid.addWidget(self.addbtn,self.row,2)
+ diodebox.setLayout(diodegrid)
+
+ #CSS
+ diodebox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(diodebox)
#Adding Device Details
self.deviceDetail[self.count] = words[0]
@@ -75,15 +95,25 @@ class DeviceModel(QtGui.QWidget):
elif eachline[0] == 'j':
print "Words",words[0]
- self.label = QtGui.QLabel("Add library for JFET "+words[0]+" : "+words[4])
- self.grid.addWidget(self.label,self.row,0)
+ jfetbox=QtGui.QGroupBox()
+ jfetgrid=QtGui.QGridLayout()
+ jfetbox.setTitle("Add library for JFET "+words[0]+" : "+words[4])
self.entry_var[self.count] = QtGui.QLineEdit()
self.entry_var[self.count].setText("")
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ jfetgrid.addWidget(self.entry_var[self.count],self.row,1)
self.addbtn = QtGui.QPushButton("Add")
self.addbtn.setObjectName("%d" %self.count)
self.addbtn.clicked.connect(self.trackLibrary)
- self.grid.addWidget(self.addbtn,self.row,2)
+ jfetgrid.addWidget(self.addbtn,self.row,2)
+ jfetbox.setLayout(jfetgrid)
+
+ #CSS
+ jfetbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(jfetbox)
#Adding Device Details
self.deviceDetail[self.count] = words[0]
@@ -95,15 +125,16 @@ class DeviceModel(QtGui.QWidget):
elif eachline[0] == 'm':
- self.label = QtGui.QLabel("Add library for MOSFET "+words[0]+" : "+words[5])
- self.grid.addWidget(self.label,self.row,0)
+ mosfetbox=QtGui.QGroupBox()
+ mosfetgrid=QtGui.QGridLayout()
+ mosfetbox.setTitle("Add library for MOSFET "+words[0]+" : "+words[5])
self.entry_var[self.count] =QtGui.QLineEdit()
self.entry_var[self.count].setText("")
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ mosfetgrid.addWidget(self.entry_var[self.count],self.row,1)
self.addbtn = QtGui.QPushButton("Add")
self.addbtn.setObjectName("%d" %self.count)
self.addbtn.clicked.connect(self.trackLibrary)
- self.grid.addWidget(self.addbtn,self.row,2)
+ mosfetgrid.addWidget(self.addbtn,self.row,2)
#Adding Device Details
self.deviceDetail[self.count] = words[0]
@@ -114,33 +145,41 @@ class DeviceModel(QtGui.QWidget):
#Adding to get MOSFET dimension
self.widthLabel[self.count] = QtGui.QLabel("Enter width of MOSFET "+words[0]+"(default=100u):")
- self.grid.addWidget(self.widthLabel[self.count],self.row,0)
+ mosfetgrid.addWidget(self.widthLabel[self.count],self.row,0)
self.entry_var[self.count] = QtGui.QLineEdit()
self.entry_var[self.count].setText("")
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ mosfetgrid.addWidget(self.entry_var[self.count],self.row,1)
self.row = self.row + 1
self.count = self.count+1
self.lengthLabel[self.count] = QtGui.QLabel("Enter length of MOSFET "+words[0]+"(default=100u):")
- self.grid.addWidget(self.lengthLabel[self.count],self.row,0)
+ mosfetgrid.addWidget(self.lengthLabel[self.count],self.row,0)
self.entry_var[self.count] = QtGui.QLineEdit()
self.entry_var[self.count].setText("")
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ mosfetgrid.addWidget(self.entry_var[self.count],self.row,1)
self.row = self.row + 1
self.count = self.count+1
self.multifactorLable[self.count] = QtGui.QLabel("Enter multiplicative factor of MOSFET "+words[0]+"(default=1):")
- self.grid.addWidget(self.multifactorLable[self.count],self.row,0)
+ mosfetgrid.addWidget(self.multifactorLable[self.count],self.row,0)
self.entry_var[self.count] = QtGui.QLineEdit()
self.entry_var[self.count].setText("")
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ mosfetgrid.addWidget(self.entry_var[self.count],self.row,1)
self.row = self.row + 1
self.count = self.count+1
+ mosfetbox.setLayout(mosfetgrid)
+
+ #CSS
+ mosfetbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+ self.grid.addWidget(mosfetbox)
self.show()
diff --git a/src/kicadtoNgspice/Model.py b/src/kicadtoNgspice/Model.py
index 4e0e4882..8ec6de7b 100644
--- a/src/kicadtoNgspice/Model.py
+++ b/src/kicadtoNgspice/Model.py
@@ -32,10 +32,10 @@ class Model(QtGui.QWidget):
#Adding title label for model
#Key: Tag name,Value:Entry widget number
tag_dict = {}
- titleLable = QtGui.QLabel(line[5])
- self.grid.addWidget(titleLable,self.nextrow,1)
- self.start = self.nextcount
- self.nextrow=self.nextrow+1
+ modelbox=QtGui.QGroupBox()
+ modelgrid=QtGui.QGridLayout()
+ modelbox.setTitle(line[5])
+ self.start=self.nextcount
#line[7] is parameter dictionary holding parameter tags.
for key,value in line[7].iteritems():
#print "Key : ",key
@@ -46,22 +46,33 @@ class Model(QtGui.QWidget):
temp_tag = []
for item in value:
paramLabel = QtGui.QLabel(item)
- self.grid.addWidget(paramLabel,self.nextrow,0)
+ modelgrid.addWidget(paramLabel,self.nextrow,0)
self.obj_trac.model_entry_var[self.nextcount]= QtGui.QLineEdit()
- self.grid.addWidget(self.obj_trac.model_entry_var[self.nextcount],self.nextrow,1)
+ modelgrid.addWidget(self.obj_trac.model_entry_var[self.nextcount],self.nextrow,1)
temp_tag.append(self.nextcount)
self.nextcount = self.nextcount+1
self.nextrow = self.nextrow+1
tag_dict[key] = temp_tag
else:
paramLabel = QtGui.QLabel(value)
- self.grid.addWidget(paramLabel,self.nextrow,0)
+ modelgrid.addWidget(paramLabel,self.nextrow,0)
self.obj_trac.model_entry_var[self.nextcount]= QtGui.QLineEdit()
- self.grid.addWidget(self.obj_trac.model_entry_var[self.nextcount],self.nextrow,1)
+ modelgrid.addWidget(self.obj_trac.model_entry_var[self.nextcount],self.nextrow,1)
tag_dict[key] = self.nextcount
self.nextcount = self.nextcount+1
self.nextrow = self.nextrow+1
self.end= self.nextcount-1
+ print "End",self.end
+ modelbox.setLayout(modelgrid)
+
+ #CSS
+ modelbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(modelbox)
+
'''
Listing all
line[0] = index