summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlaine2020-06-10 18:24:51 +0530
committerBlaine2020-06-10 18:24:51 +0530
commit69f088e51236c41b2278aba9e53866dd791ef533 (patch)
tree851c08b7b1553a03f370350351071a0a1d2cab1a /src
parenta43e954ab840e91141359dba0a2794dd12c105be (diff)
downloadChemical-PFD-69f088e51236c41b2278aba9e53866dd791ef533.tar.gz
Chemical-PFD-69f088e51236c41b2278aba9e53866dd791ef533.tar.bz2
Chemical-PFD-69f088e51236c41b2278aba9e53866dd791ef533.zip
stylize label
Diffstat (limited to 'src')
-rw-r--r--src/main/python/utils/toolbar.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py
index e488464..39b251a 100644
--- a/src/main/python/utils/toolbar.py
+++ b/src/main/python/utils/toolbar.py
@@ -83,7 +83,7 @@ class toolbar(QDockWidget):
# self.setFixedHeight(self.height()) #span available height
width = self.width() - QApplication.style().pixelMetric(QStyle.PM_ScrollBarExtent)
for _, label in self.toolbarLabelDict.items():
- label.setFixedWidth(width)
+ label.setFixedWidth(self.width())
# the following line, sets the required height for the current width, so that blank space doesnt occur
self.diagAreaWidget.setMinimumHeight(self.diagAreaLayout.heightForWidth(width))
self.setMinimumWidth(.17*parent.width()) #12% of parent width
@@ -95,7 +95,7 @@ class toolbar(QDockWidget):
#helper functions to create required buttons
for itemClass in itemClasses:
self.toolbarButtonDict[itemClass] = {}
- label = QLabel(itemClass)
+ label = sectionLabel(itemClass)
self.toolbarLabelDict[itemClass] = label
for item in toolbarItems[itemClass].keys():
obj = toolbarItems[itemClass][item]
@@ -151,4 +151,18 @@ class toolbarButton(QToolButton):
def minimumSizeHint(self):
#defines button size
- return QSize(40, 40) \ No newline at end of file
+ return QSize(40, 40)
+
+class sectionLabel(QLabel):
+
+ def __init__(self, *args):
+ super(sectionLabel, self).__init__(*args)
+ self.setAlignment(Qt.AlignHCenter)
+ self.setStyleSheet("""
+ QLabel{
+ background-color: #E6E6E3;
+ border: 1px solid black;
+ border-left: 0px;
+ background-clip: padding;
+ }
+ """) \ No newline at end of file