From 0c4c1cc4a0103c3bfda0693e24ae0cc7841b6cbd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 12:13:30 +0200 Subject: [PATCH 1/4] pype tray is using openpype style for tray menu --- openpype/tools/tray/pype_tray.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/openpype/tools/tray/pype_tray.py b/openpype/tools/tray/pype_tray.py index d9806a96fd..2c739e3e39 100644 --- a/openpype/tools/tray/pype_tray.py +++ b/openpype/tools/tray/pype_tray.py @@ -5,13 +5,19 @@ import atexit import subprocess import platform -from avalon import style + from Qt import QtCore, QtGui, QtWidgets -from openpype.api import Logger, resources + +import openpype.version +from openpype.api import ( + Logger, + resources, + get_system_settings +) from openpype.lib import get_pype_execute_args from openpype.modules import TrayModulesManager, ITrayService -from openpype.settings.lib import get_system_settings -import openpype.version +from openpype import style + from .pype_info_widget import PypeInfoWidget From 8ffb70b93e7b635223567408c3f5265f1c7a86a4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 12:13:49 +0200 Subject: [PATCH 2/4] Pype info widget is using openpype style --- openpype/tools/tray/pype_info_widget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/tools/tray/pype_info_widget.py b/openpype/tools/tray/pype_info_widget.py index bbb92f175f..175a2df3c5 100644 --- a/openpype/tools/tray/pype_info_widget.py +++ b/openpype/tools/tray/pype_info_widget.py @@ -2,8 +2,9 @@ import os import json import collections -from avalon import style from Qt import QtCore, QtGui, QtWidgets + +from openpype import style from openpype.api import resources from openpype.settings.lib import get_local_settings from openpype.lib.pype_info import ( @@ -118,7 +119,6 @@ class EnvironmentsView(QtWidgets.QTreeView): return super(EnvironmentsView, self).wheelEvent(event) - class ClickableWidget(QtWidgets.QWidget): clicked = QtCore.Signal() From deb77e8b0006d77f0527754f225e2c68e01d7ebb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 12:14:01 +0200 Subject: [PATCH 3/4] replaced spacer widget with stretch --- openpype/tools/tray/pype_info_widget.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openpype/tools/tray/pype_info_widget.py b/openpype/tools/tray/pype_info_widget.py index 175a2df3c5..cf4c84301b 100644 --- a/openpype/tools/tray/pype_info_widget.py +++ b/openpype/tools/tray/pype_info_widget.py @@ -144,16 +144,14 @@ class CollapsibleWidget(QtWidgets.QWidget): button_toggle.setChecked(False) label_widget = QtWidgets.QLabel(label, parent=top_part) - spacer_widget = QtWidgets.QWidget(top_part) top_part_layout = QtWidgets.QHBoxLayout(top_part) top_part_layout.setContentsMargins(0, 0, 0, 5) top_part_layout.addWidget(button_toggle) top_part_layout.addWidget(label_widget) - top_part_layout.addWidget(spacer_widget, 1) + top_part_layout.addStretch(1) label_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) - spacer_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.button_toggle = button_toggle From cf10f50229406fd97b5db762f1decbc91546c887 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Jun 2021 12:14:41 +0200 Subject: [PATCH 4/4] use object name for separator color instead of hardcoded color in code --- openpype/style/style.css | 5 +++++ openpype/tools/tray/pype_info_widget.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/openpype/style/style.css b/openpype/style/style.css index 78052a9fdd..87df484843 100644 --- a/openpype/style/style.css +++ b/openpype/style/style.css @@ -481,6 +481,11 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; } +/* Globally used names */ +#Separator { + background: {color:bg-menu-separator}; +} + #IconBtn {} /* Project Manager stylesheets */ diff --git a/openpype/tools/tray/pype_info_widget.py b/openpype/tools/tray/pype_info_widget.py index cf4c84301b..f95a31f7c2 100644 --- a/openpype/tools/tray/pype_info_widget.py +++ b/openpype/tools/tray/pype_info_widget.py @@ -295,7 +295,7 @@ class PypeInfoSubWidget(QtWidgets.QWidget): def _create_separator(self): separator_widget = QtWidgets.QWidget(self) - separator_widget.setStyleSheet("background: #222222;") + separator_widget.setObjectName("Separator") separator_widget.setMinimumHeight(2) separator_widget.setMaximumHeight(2) return separator_widget