From d798bdc35ffedd5d6b9539dcb2edf55d150ff237 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 18:55:49 +0200 Subject: [PATCH 1/9] use WA_TranslucentBackground instead of stylesheet --- .../tools/standalonepublish/widgets/widget_drop_empty.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/openpype/tools/standalonepublish/widgets/widget_drop_empty.py b/openpype/tools/standalonepublish/widgets/widget_drop_empty.py index ed526f2a78..a890f38426 100644 --- a/openpype/tools/standalonepublish/widgets/widget_drop_empty.py +++ b/openpype/tools/standalonepublish/widgets/widget_drop_empty.py @@ -21,16 +21,12 @@ class DropEmpty(QtWidgets.QWidget): self._label = QtWidgets.QLabel('Drag & Drop') self._label.setFont(font) - self._label.setStyleSheet( - 'background-color: transparent;' - ) + self._label.setAttribute(QtCore.Qt.WA_TranslucentBackground) font.setPointSize(12) self._sub_label = QtWidgets.QLabel('(drop files here)') self._sub_label.setFont(font) - self._sub_label.setStyleSheet( - 'background-color: transparent;' - ) + self._sub_label.setAttribute(QtCore.Qt.WA_TranslucentBackground) layout.addWidget(self._label, alignment=BottomCenterAlignment) layout.addWidget(self._sub_label, alignment=TopCenterAlignment) From ff9d0e598a99ffdf034796a6ee8d9c8832c6ee76 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 18:56:11 +0200 Subject: [PATCH 2/9] version spinbox is without boxes --- openpype/tools/standalonepublish/widgets/widget_family.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/tools/standalonepublish/widgets/widget_family.py b/openpype/tools/standalonepublish/widgets/widget_family.py index 86663c8ee0..e4222869a4 100644 --- a/openpype/tools/standalonepublish/widgets/widget_family.py +++ b/openpype/tools/standalonepublish/widgets/widget_family.py @@ -55,6 +55,7 @@ class FamilyWidget(QtWidgets.QWidget): # version version_spinbox = QtWidgets.QSpinBox() + version_spinbox.setButtonSymbols(QtWidgets.QSpinBox.NoButtons) version_spinbox.setMinimum(1) version_spinbox.setMaximum(9999) version_spinbox.setEnabled(False) From d16ac9f1de988a2e7aa32030d4e5031c0f491bea Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 19:00:38 +0200 Subject: [PATCH 3/9] added few named styles for standalone publisher --- openpype/style/style.css | 48 +++++++++++++++++++ openpype/tools/standalonepublish/app.py | 2 +- .../widgets/widget_component_item.py | 4 ++ .../widgets/widget_components_list.py | 2 + 4 files changed, 55 insertions(+), 1 deletion(-) diff --git a/openpype/style/style.css b/openpype/style/style.css index 576a0008eb..9af5e2b575 100644 --- a/openpype/style/style.css +++ b/openpype/style/style.css @@ -164,6 +164,40 @@ QComboBox::down-arrow, QComboBox::down-arrow:on, QComboBox::down-arrow:hover, QC image: url(:/openpype/images/combobox_arrow.png); } +/* Splitter */ +QSplitter { + border: 0px; +} + +QSplitter::handle { + border: 1px dashed {color:bg-view}; +} + +QSplitter::handle:hover { + background: {color:bg-menu-separator}; + border: 1px solid {color:bg-view}; +} + +QSplitter::handle:horizontal { + width: 1px; + background-color: transparent; +} + +QSplitter::handle:vertical { + height: 1px; + background-color: transparent; +} + +QSplitter::handle:vertical:hover { + background: {color:bg-menu-separator}; + border: 1px solid {color:bg-view}; +} + +QSplitter::handle:horizontal:hover { + background: {color:bg-menu-separator}; + border: 1px solid {color:bg-view}; +} + /* SLider */ QSlider::groove { border: 1px solid #464b54; @@ -542,3 +576,17 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { #IconView[mode="icon"]::icon { top: 3px; } + +/* Standalone publisher */ +#ComponentList { + outline: none; +} + +#ComponentItem { + background: transparent; +} + +#ComponentFrame { + border: 1px solid {color:border}; + border-radius: 0.1em; +} diff --git a/openpype/tools/standalonepublish/app.py b/openpype/tools/standalonepublish/app.py index 7d25a8ca55..1fd00526ce 100644 --- a/openpype/tools/standalonepublish/app.py +++ b/openpype/tools/standalonepublish/app.py @@ -10,7 +10,7 @@ from .widgets import ( AssetWidget, FamilyWidget, ComponentsWidget, ShadowWidget ) from .widgets.constants import HOST_NAME -from avalon import style +from openpype import style from openpype.api import resources from avalon.api import AvalonMongoDB from openpype.modules import ModulesManager diff --git a/openpype/tools/standalonepublish/widgets/widget_component_item.py b/openpype/tools/standalonepublish/widgets/widget_component_item.py index 3850d68b96..186c8024db 100644 --- a/openpype/tools/standalonepublish/widgets/widget_component_item.py +++ b/openpype/tools/standalonepublish/widgets/widget_component_item.py @@ -16,6 +16,9 @@ class ComponentItem(QtWidgets.QFrame): def __init__(self, parent, main_parent): super().__init__() + + self.setObjectName("ComponentItem") + self.has_valid_repre = True self.actions = [] self.resize(290, 70) @@ -32,6 +35,7 @@ class ComponentItem(QtWidgets.QFrame): # Main widgets frame = QtWidgets.QFrame(self) + frame.setObjectName("ComponentFrame") frame.setFrameShape(QtWidgets.QFrame.StyledPanel) frame.setFrameShadow(QtWidgets.QFrame.Raised) diff --git a/openpype/tools/standalonepublish/widgets/widget_components_list.py b/openpype/tools/standalonepublish/widgets/widget_components_list.py index 4e502a2e5f..0ee90ae4de 100644 --- a/openpype/tools/standalonepublish/widgets/widget_components_list.py +++ b/openpype/tools/standalonepublish/widgets/widget_components_list.py @@ -5,6 +5,8 @@ class ComponentsList(QtWidgets.QTableWidget): def __init__(self, parent=None): super().__init__(parent=parent) + self.setObjectName("ComponentList") + self._main_column = 0 self.setColumnCount(1) From 709757c69a0883b7cec07c38a2647e0eb7ac5e43 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 19:00:58 +0200 Subject: [PATCH 4/9] don't use hardcoded stylesheet --- openpype/tools/standalonepublish/widgets/widget_family.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openpype/tools/standalonepublish/widgets/widget_family.py b/openpype/tools/standalonepublish/widgets/widget_family.py index e4222869a4..7be3c8d517 100644 --- a/openpype/tools/standalonepublish/widgets/widget_family.py +++ b/openpype/tools/standalonepublish/widgets/widget_family.py @@ -37,7 +37,6 @@ class FamilyWidget(QtWidgets.QWidget): input_subset = QtWidgets.QLineEdit() input_result = QtWidgets.QLineEdit() - input_result.setStyleSheet("color: #BBBBBB;") input_result.setEnabled(False) # region Menu for default subset names @@ -59,7 +58,6 @@ class FamilyWidget(QtWidgets.QWidget): version_spinbox.setMinimum(1) version_spinbox.setMaximum(9999) version_spinbox.setEnabled(False) - version_spinbox.setStyleSheet("color: #BBBBBB;") version_checkbox = QtWidgets.QCheckBox("Next Available Version") version_checkbox.setCheckState(QtCore.Qt.CheckState(2)) From cb67bc5d65387f0a7671c0274d861ebbb3c03437 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 19:01:14 +0200 Subject: [PATCH 5/9] define stretch of subset name input and button --- openpype/tools/standalonepublish/widgets/widget_family.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/tools/standalonepublish/widgets/widget_family.py b/openpype/tools/standalonepublish/widgets/widget_family.py index 7be3c8d517..ef516f7642 100644 --- a/openpype/tools/standalonepublish/widgets/widget_family.py +++ b/openpype/tools/standalonepublish/widgets/widget_family.py @@ -48,8 +48,8 @@ class FamilyWidget(QtWidgets.QWidget): # endregion name_layout = QtWidgets.QHBoxLayout() - name_layout.addWidget(input_subset) - name_layout.addWidget(btn_subset) + name_layout.addWidget(input_subset, 1) + name_layout.addWidget(btn_subset, 0) name_layout.setContentsMargins(0, 0, 0, 0) # version From 2b86d0c20b5a1827e8a30a2e33fca65c367d6a1a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 19:01:24 +0200 Subject: [PATCH 6/9] don't set fixed height of button --- openpype/tools/standalonepublish/widgets/widget_family.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/tools/standalonepublish/widgets/widget_family.py b/openpype/tools/standalonepublish/widgets/widget_family.py index ef516f7642..682a6fc974 100644 --- a/openpype/tools/standalonepublish/widgets/widget_family.py +++ b/openpype/tools/standalonepublish/widgets/widget_family.py @@ -42,7 +42,6 @@ class FamilyWidget(QtWidgets.QWidget): # region Menu for default subset names btn_subset = QtWidgets.QPushButton() btn_subset.setFixedWidth(18) - btn_subset.setFixedHeight(20) menu_subset = QtWidgets.QMenu(btn_subset) btn_subset.setMenu(menu_subset) From 4a8498db27e161e80dd607fbd3d045519debfb9b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 19:02:34 +0200 Subject: [PATCH 7/9] create mongo connection on init instead of in class definition --- openpype/tools/standalonepublish/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/tools/standalonepublish/app.py b/openpype/tools/standalonepublish/app.py index 1fd00526ce..169abe530a 100644 --- a/openpype/tools/standalonepublish/app.py +++ b/openpype/tools/standalonepublish/app.py @@ -22,7 +22,6 @@ class Window(QtWidgets.QDialog): :param parent: Main widget that cares about all GUIs :type parent: QtWidgets.QMainWindow """ - _db = AvalonMongoDB() _jobs = {} valid_family = False valid_components = False @@ -32,6 +31,7 @@ class Window(QtWidgets.QDialog): def __init__(self, pyblish_paths, parent=None): super(Window, self).__init__(parent=parent) + self._db = AvalonMongoDB() self._db.install() self.pyblish_paths = pyblish_paths From 7b6ff7569f8e21e4d909406f1bf8e880df33ed49 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 19:13:38 +0200 Subject: [PATCH 8/9] added menu indicator for qpushbutton --- openpype/style/style.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openpype/style/style.css b/openpype/style/style.css index 9af5e2b575..5359400f32 100644 --- a/openpype/style/style.css +++ b/openpype/style/style.css @@ -72,6 +72,14 @@ QPushButton:disabled { background: {color:bg-buttons-disabled}; } +QPushButton::menu-indicator { + subcontrol-origin: padding; + subcontrol-position: right; + width: 8px; + height: 8px; + padding-right: 5px; +} + QToolButton { border: none; background: transparent; From 95b41ea8a48a4abfb51306b59223cac7432a4b73 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 20:04:29 +0200 Subject: [PATCH 9/9] reduced qplistter styles --- openpype/style/style.css | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/openpype/style/style.css b/openpype/style/style.css index 5359400f32..7db3558c14 100644 --- a/openpype/style/style.css +++ b/openpype/style/style.css @@ -174,36 +174,11 @@ QComboBox::down-arrow, QComboBox::down-arrow:on, QComboBox::down-arrow:hover, QC /* Splitter */ QSplitter { - border: 0px; + border: none; } QSplitter::handle { - border: 1px dashed {color:bg-view}; -} - -QSplitter::handle:hover { - background: {color:bg-menu-separator}; - border: 1px solid {color:bg-view}; -} - -QSplitter::handle:horizontal { - width: 1px; - background-color: transparent; -} - -QSplitter::handle:vertical { - height: 1px; - background-color: transparent; -} - -QSplitter::handle:vertical:hover { - background: {color:bg-menu-separator}; - border: 1px solid {color:bg-view}; -} - -QSplitter::handle:horizontal:hover { - background: {color:bg-menu-separator}; - border: 1px solid {color:bg-view}; + border: 1px dotted {color:bg-menu-separator}; } /* SLider */