From 8a9d815278746f5b49cf09b4cb50e8b5647b4a7e Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:29:44 +0200 Subject: [PATCH] use class name over object name for formatting --- client/ayon_core/style/style.css | 10 +++++----- client/ayon_core/tools/utils/widgets.py | 15 ++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/client/ayon_core/style/style.css b/client/ayon_core/style/style.css index 2c826f16a4..1af355ac7b 100644 --- a/client/ayon_core/style/style.css +++ b/client/ayon_core/style/style.css @@ -740,22 +740,22 @@ OverlayMessageWidget QWidget { } /* Hinted Line Edit */ -#HintedLineEditInput { +HintedLineEditInput { border-radius: 0.2em; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border: 1px solid {color:border}; } -#HintedLineEditInput:hover { +HintedLineEditInput:hover { border-color: {color:border-hover}; } -#HintedLineEditInput:focus{ +HintedLineEditInput:focus{ border-color: {color:border-focus}; } -#HintedLineEditInput:disabled { +HintedLineEditInput:disabled { background: {color:bg-inputs-disabled}; } -#HintedLineEditButton { +HintedLineEditButton { border: none; border-radius: 0.2em; border-bottom-left-radius: 0px; diff --git a/client/ayon_core/tools/utils/widgets.py b/client/ayon_core/tools/utils/widgets.py index 8109130c27..008f48c502 100644 --- a/client/ayon_core/tools/utils/widgets.py +++ b/client/ayon_core/tools/utils/widgets.py @@ -121,6 +121,14 @@ def get_down_arrow_icon() -> QtGui.QIcon: return icon +class HintedLineEditInput(PlaceholderLineEdit): + pass + + +class HintedLineEditButton(QtWidgets.QPushButton): + pass + + class HintedLineEdit(QtWidgets.QWidget): SEPARATORS: Set[str] = {"---", "---separator---"} returnPressed = QtCore.Signal() @@ -134,11 +142,8 @@ class HintedLineEdit(QtWidgets.QWidget): ): super().__init__(parent) - text_input = PlaceholderLineEdit(self) - options_button = QtWidgets.QPushButton(self) - - text_input.setObjectName("HintedLineEditInput") - options_button.setObjectName("HintedLineEditButton") + text_input = HintedLineEditInput(self) + options_button = HintedLineEditButton(self) options_button.setIcon(get_down_arrow_icon()) main_layout = QtWidgets.QHBoxLayout(self)