From 6c916803c804fd9a5592ff2b4176a26481d43e45 Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Fri, 15 Oct 2021 00:57:23 +0300 Subject: [PATCH] Emit textChanged signal at the end of __edit in IndicatorLineEdit. Fix indicator being always green at startup. Cleanup the syntax of the RareStyle stylesheet. --- .../stylesheets/RareStyle/stylesheet.qss | 42 +++++++++---------- rare/utils/extra_widgets.py | 6 +-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/rare/resources/stylesheets/RareStyle/stylesheet.qss b/rare/resources/stylesheets/RareStyle/stylesheet.qss index b21b2477..caeb60b8 100644 --- a/rare/resources/stylesheets/RareStyle/stylesheet.qss +++ b/rare/resources/stylesheets/RareStyle/stylesheet.qss @@ -4,7 +4,7 @@ * { background-color: #202225; } * { color: #eeeeee; } * { border-color: #483d8b; } -*::disabled, +*:disabled, *::drop-down:disabled { color: #43474d; border-color: #43474d; @@ -235,8 +235,8 @@ QPushButton, QToolButton { background-color: #3c3f41; } -QPushButton::hover, -QToolButton::hover, +QPushButton:hover, +QToolButton:hover, QHeaderView::section:hover { background-color: #222233; } @@ -267,34 +267,34 @@ QPushButton#menu_button { height: 18px; } QPushButton:hover#menu_button { - background-color: #334; + background-color: "#334"; } QPushButton[install="1"], QPushButton#install_button { - background-color: #090; + background-color: "#090"; } -QPushButton[install="1"]::hover, -QPushButton::hover#install_button { - background-color: #060; +QPushButton[install="1"]:hover, +QPushButton:hover#install_button { + background-color: "#060"; } -QPushButton[install="1"]::disabled, -QPushButton::disabled#install_button { - background-color: #020; +QPushButton[install="1"]:disabled, +QPushButton:disabled#install_button { + background-color: "#020"; } QPushButton[uninstall="1"], QPushButton#uninstall_button { - background-color: #900; + background-color: "#900"; } -QPushButton[uninstall="1"]::hover, -QPushButton::hover#uninstall_button { - background-color: #600; +QPushButton[uninstall="1"]:hover, +QPushButton:hover#uninstall_button { + background-color: "#600"; } -QPushButton[uninstall="1"]::disabled, -QPushButton::disabled#uninstall_button { - background-color: #200; +QPushButton[uninstall="1"]:disabled, +QPushButton:disabled#uninstall_button { + background-color: "#200"; } QPushButton#success{ - background-color: lime; + background-color: "lime"; } QPushButton:hover#installed_menu_button { background-color: green; @@ -410,7 +410,7 @@ QSizeGrip { #search_bar { padding: 3px; border-radius: 5px; - background-color: #334; + background-color: "#334"; } QTabWidget::pane { @@ -495,7 +495,7 @@ QTabBar::tab:selected:right { background: qlineargradient(x1: 2, y1: 0, x2: 0, y2: 0, stop: 0 #483d8b, stop: 1 #202225); /* stop: 0 #2f4f4f stop: 0.2 #203636 */ } -QTabBar::tab:disabled#side_tab_bar { +QTabBar::tab:disabled#SideTabBar { color: transparent; border-color: transparent; background-color: transparent; diff --git a/rare/utils/extra_widgets.py b/rare/utils/extra_widgets.py index ae2c9421..5bb5771f 100644 --- a/rare/utils/extra_widgets.py +++ b/rare/utils/extra_widgets.py @@ -148,7 +148,7 @@ class IndicatorLineEdit(QWidget): self.indicator_label = QLabel() self.indicator_label.setPixmap(icon("ei.info-circle", color="gray").pixmap(16, 16)) self.indicator_label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - self.__indicator(edit_func(text)) + self.__indicator(edit_func(text)[0]) self.layout.addWidget(self.indicator_label) if not ph_text: @@ -181,9 +181,9 @@ class IndicatorLineEdit(QWidget): self.line_edit.setText(text) self.line_edit.blockSignals(False) self.__indicator(self.is_valid) - self.textChanged.emit(text) if self.is_valid: self.__save(text) + self.textChanged.emit(text) def __save(self, text): if self.save_func is not None: @@ -237,7 +237,7 @@ class PathEdit(IndicatorLineEdit): class SideTabBar(QTabBar): def __init__(self, parent=None): super(SideTabBar, self).__init__(parent=parent) - self.setObjectName("side_tab_bar") + self.setObjectName("SideTabBar") self.fm = QFontMetrics(self.font()) def tabSizeHint(self, index):