apol: Use stylesheet to create a border around all QGroupBoxes.

Apply stylesheet in SEToolsWidget so all widgets will have the sheet
and it will propagate to child widgets.  This will add more visual
grouping to related options.  Adjust BooleanQueryTab so
the "Default State" group box title is completely shown.
This commit is contained in:
Chris PeBenito 2016-05-02 10:34:02 -04:00
parent ce821b850f
commit 2ec9336009
2 changed files with 23 additions and 0 deletions

View File

@ -222,6 +222,12 @@
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="default_criteria">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Default State</string>
</property>

View File

@ -22,6 +22,21 @@ from errno import ENOENT
from PyQt5.uic import loadUi
# Stylesheet that adds a frame around QGroupBoxes
stylesheet = "\
QGroupBox {\
border: 1px solid lightgrey;\
margin-top: 0.5em;\
}\
\
QGroupBox::title {\
subcontrol-origin: margin;\
left: 10px;\
padding: 0 3px 0 3px;\
}\
"
class SEToolsWidget(object):
def load_ui(self, filename):
# If we are in the git repo, look at the local
@ -35,3 +50,5 @@ class SEToolsWidget(object):
raise
else:
raise RuntimeError("Unable to load Qt UI file \"{0}\"".format(filename))
self.setStyleSheet(stylesheet)