Permalink
Browse files

Fix display issues with dialogs that involved bad vertical spacing.

Make use of newer Houdini provided styles/widget things to improve look.
  • Loading branch information...
captainhammy committed Sep 27, 2017
1 parent 820d6a4 commit 801c87cc5531b09ded68343734416c10415969db
Showing with 25 additions and 89 deletions.
  1. +19 −18 python/ht/ui/aovs/dialogs.py
  2. +0 −65 python/ht/ui/aovs/uidata.py
  3. +6 −6 python/ht/ui/aovs/widgets.py
@@ -61,7 +61,6 @@ def __init__(self, parent=None):
self.initUI()
self.setMinimumWidth(450)
self.setFixedHeight(525)
# =========================================================================
# NON-PUBLIC METHODS
@@ -224,6 +223,8 @@ def initUI(self):
grid_layout = QtWidgets.QGridLayout()
layout.addLayout(grid_layout)
grid_layout.setSpacing(5)
row = 1
# =====================================================================
@@ -239,7 +240,7 @@ def initUI(self):
grid_layout.addWidget(QtWidgets.QLabel("VEX Type"), row, 0)
self.type_box = QtWidgets.QComboBox()
self.type_box = widgets.ComboBox()
grid_layout.addWidget(self.type_box, row, 1)
for entry in uidata.VEXTYPE_MENU_ITEMS:
@@ -270,7 +271,7 @@ def initUI(self):
grid_layout.addWidget(QtWidgets.QLabel("Quantize"), row, 0)
self.quantize_box = QtWidgets.QComboBox()
self.quantize_box = widgets.ComboBox()
grid_layout.addWidget(self.quantize_box, row, 1)
for entry in uidata.QUANTIZE_MENU_ITEMS:
@@ -284,7 +285,7 @@ def initUI(self):
grid_layout.addWidget(QtWidgets.QLabel("Sample Filter"), row, 0)
self.sfilter_box = QtWidgets.QComboBox()
self.sfilter_box = widgets.ComboBox()
grid_layout.addWidget(self.sfilter_box, row, 1)
for entry in uidata.SFILTER_MENU_ITEMS:
@@ -305,7 +306,7 @@ def initUI(self):
# =====================================================================
grid_layout.setRowMinimumHeight(row, 25)
grid_layout.setRowMinimumHeight(row, 15)
row += 1
@@ -317,14 +318,14 @@ def initUI(self):
0
)
self.exclude_from_dcm = QtWidgets.QCheckBox()
self.exclude_from_dcm = hou.qt.createCheckBox()
grid_layout.addWidget(self.exclude_from_dcm, row, 1)
row += 1
# =====================================================================
grid_layout.setRowMinimumHeight(row, 25)
grid_layout.setRowMinimumHeight(row, 15)
row += 1
@@ -334,7 +335,7 @@ def initUI(self):
grid_layout.addWidget(self.export_label, row, 0, 2, 1)
self.componentexport = QtWidgets.QCheckBox()
self.componentexport = hou.qt.createCheckBox()
grid_layout.addWidget(self.componentexport, row, 1, 2, 1)
row += 2
@@ -344,7 +345,7 @@ def initUI(self):
self.component_mode_label = QtWidgets.QLabel("Set Components")
grid_layout.addWidget(self.component_mode_label, row, 0)
self.component_mode = QtWidgets.QComboBox()
self.component_mode = widgets.ComboBox()
grid_layout.addWidget(self.component_mode, row, 1)
self.component_mode.addItem("From ROP", "rop")
@@ -381,15 +382,15 @@ def initUI(self):
# =====================================================================
grid_layout.setRowMinimumHeight(row, 25)
grid_layout.setRowMinimumHeight(row, 15)
row += 1
# =====================================================================
grid_layout.addWidget(QtWidgets.QLabel("Light Exports"), row, 0)
self.lightexport = QtWidgets.QComboBox()
self.lightexport = widgets.ComboBox()
grid_layout.addWidget(self.lightexport, row, 1)
for entry in uidata.LIGHTEXPORT_MENU_ITEMS:
@@ -431,15 +432,15 @@ def initUI(self):
# =====================================================================
grid_layout.setRowMinimumHeight(row, 25)
grid_layout.setRowMinimumHeight(row, 15)
row += 1
# =====================================================================
grid_layout.addWidget(QtWidgets.QLabel("Priority"), row, 0)
self.priority = widgets.CustomSpinBox()
self.priority = QtWidgets.QSpinBox()
grid_layout.addWidget(self.priority, row, 1)
self.priority.setMinimum(-1)
@@ -462,7 +463,7 @@ def initUI(self):
# =====================================================================
grid_layout.setRowMinimumHeight(row, 25)
grid_layout.setRowMinimumHeight(row, 15)
row += 1
@@ -481,7 +482,7 @@ def initUI(self):
# =====================================================================
grid_layout.setRowMinimumHeight(row, 25)
grid_layout.setRowMinimumHeight(row, 15)
row += 1
@@ -900,7 +901,7 @@ def initUI(self):
grid_layout.addWidget(QtWidgets.QLabel("Priority"), 4, 0)
self.priority = widgets.CustomSpinBox()
self.priority = QtWidgets.QSpinBox()
grid_layout.addWidget(self.priority, 4, 1)
self.priority.setMinimum(-1)
@@ -1281,7 +1282,7 @@ def initUI(self):
layout = QtWidgets.QVBoxLayout()
self.setLayout(layout)
self.aov_chooser = QtWidgets.QComboBox()
self.aov_chooser = widgets.ComboBox()
layout.addWidget(self.aov_chooser)
# Start menu index.
@@ -1470,7 +1471,7 @@ def initUI(self):
# =====================================================================
self.group_chooser = QtWidgets.QComboBox()
self.group_chooser = widgets.ComboBox()
layout.addWidget(self.group_chooser)
# Start menu index.
@@ -73,71 +73,6 @@
}
"""
# Style for custom MenuField widget.
MENUFIELD_STYLE = """
QPushButton
{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0.0 rgb(63, 63, 63),
stop: 1.0 rgb(38, 38, 38));
height: 14px;
width: 11px;
border: 1px solid rgba(0,0,0,102);
}
QPushButton::menu-indicator
{
subcontrol-position: center;
height: 16;
width: 6;
}
"""
# Style for CustomSpinBox widget.
CUSTOMSPINBOX_STYLE = """
CustomSpinBox {
border: 1px solid rgba(0,0,0,102);
border-radius: 1px;
background: rgb(19, 19, 19);
selection-color: rgb(0, 0, 0);
selection-background-color: rgb(184, 134, 32);
}
CustomSpinBox::up-button {
subcontrol-origin: border;
subcontrol-position: top right; /* position at the top right corner */
width: 16px;
border-width: 1px;
background: rgb(38, 38, 38);
width: 20px;
}
CustomSpinBox::down-button {
subcontrol-origin: border;
subcontrol-position: bottom right; /* position at bottom right corner */
border-image: url(:/images/spindown.png) 1;
border-width: 1px;
border-top-width: 0;
background: rgb(38, 38, 38);
width: 20px;
}
CustomSpinBox::up-arrow {
image: url(:ht/rsc/icons/aovs/button_up.png) 1;
width: 14px;
height: 14px;
}
CustomSpinBox::down-arrow
{
image: url(:ht/rsc/icons/aovs/button_down.png) 1;
width: 14px;
height: 14px;
}
"""
# Generic tooltip style.
TOOLTIP_STYLE = """
QToolTip {
@@ -1711,13 +1711,12 @@ def __init__(self, group, parent=None):
# Generic Widgets
# =============================================================================
class CustomSpinBox(QtWidgets.QSpinBox):
"""A QSpinBox with a custom stylesheet."""
class ComboBox(QtWidgets.QComboBox):
def __init__(self, parent=None):
super(CustomSpinBox, self).__init__(parent)
super(ComboBox, self).__init__(parent)
self.setStyleSheet(uidata.CUSTOMSPINBOX_STYLE)
self.setView(QtWidgets.QListView())
class FileChooser(QtWidgets.QWidget):
@@ -1888,6 +1887,8 @@ def __init__(self, menu_items, mode=MenuFieldMode.Replace, parent=None):
button = QtWidgets.QPushButton()
layout.addWidget(button)
button.setProperty("menu", True)
menu = QtWidgets.QMenu(button)
for item in menu_items:
@@ -1907,8 +1908,6 @@ def __init__(self, menu_items, mode=MenuFieldMode.Replace, parent=None):
button.setMenu(menu)
button.setStyleSheet(uidata.MENUFIELD_STYLE)
# =========================================================================
# METHODS
# =========================================================================
@@ -2064,3 +2063,4 @@ def updateDisplay(self):
self.display.clear()
self.display.hide()
self.icon.hide()

0 comments on commit 801c87c

Please sign in to comment.