From ea272c29b621a7662ca9d463210e43d0087683c9 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 13 Nov 2025 15:43:13 +0700 Subject: [PATCH] WINETRICKS_TABBLE_STYLE reworked --- portprotonqt/dialogs.py | 31 ++++---- portprotonqt/themes/standart/styles.py | 99 ++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 15 deletions(-) diff --git a/portprotonqt/dialogs.py b/portprotonqt/dialogs.py index 0e9ed14..c61a605 100644 --- a/portprotonqt/dialogs.py +++ b/portprotonqt/dialogs.py @@ -1783,6 +1783,7 @@ class ExeSettingsDialog(QDialog): # Tab widget self.tab_widget = QTabWidget() + self.tab_widget.setStyleSheet(self.theme.WINETRICKS_TAB_STYLE) self.main_tab = QWidget() self.main_tab_layout = QVBoxLayout(self.main_tab) self.advanced_tab = QWidget() @@ -2152,21 +2153,21 @@ class ExeSettingsDialog(QDialog): self.advanced_table.setItem(row, 2, desc_item) # Make sure QLineEdit and QComboBox look consistent - self.advanced_table.setStyleSheet(""" - QComboBox, QLineEdit { - padding: 3px 6px; - min-height: 26px; - } - QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 18px; - } - QTextEdit { - border-radius: 4px; - padding: 4px; - } - """) + # self.advanced_table.setStyleSheet(""" + # QComboBox, QLineEdit { + # padding: 3px 6px; + # min-height: 26px; + # } + # QComboBox::drop-down { + # subcontrol-origin: padding; + # subcontrol-position: top right; + # width: 18px; + # } + # QTextEdit { + # border-radius: 4px; + # padding: 4px; + # } + # """) def apply_changes(self): """Apply changes by collecting diffs from both main and advanced tabs.""" diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 4c49471..bc278cb 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -990,6 +990,104 @@ QTabBar::tab:hover {{ """ WINETRICKS_TABBLE_STYLE = f""" +QComboBox {{ + background: {color_c}; + border: {border_c} {color_g}; + border-radius: {border_radius_a}; + padding-left: 12px; + color: {color_f}; + font-family: '{font_family}'; + font-size: {font_size_a}; + min-width: 120px; + combobox-popup: 0; +}} +QComboBox:on {{ + background: {color_b}; + border: {border_c} {color_a}; + border-bottom-style: none; + border-top-left-radius: 10px; + border-top-right-radius: 10px; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +}} +QComboBox:hover {{ + border: {border_c} {color_a}; + background: {color_a}; +}} +/* Состояние фокуса */ +QComboBox:focus {{ + border: {border_c} {color_a}; + background-color: {color_a}; +}} +QComboBox::drop-down {{ + subcontrol-origin: padding; + subcontrol-position: center right; + border-left: {border_b} rgba(255, 255, 255, 0.05); + padding: 12px; + height: 12px; + width: 12px; +}} +QComboBox::down-arrow {{ + image: url({theme_manager.get_icon("down", current_theme_name, as_path=True)}); + padding: 12px; + height: 12px; + width: 12px; +}} +QComboBox::down-arrow:on {{ + image: url({theme_manager.get_icon("up", current_theme_name, as_path=True)}); + padding: 12px; + height: 12px; + width: 12px; +}} +/* Список при открытом комбобоксе */ +QComboBox QAbstractItemView {{ + outline: none; + background: {color_c}; + border: {border_c} {color_a}; + border-top-style: none; + border-top-left-radius: 0px; + border-top-right-radius: 0px; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; +}} +QListView {{ + background: {color_c}; +}} +QListView::item {{ + padding: 7px 7px 7px 12px; + margin: 3px; + border-radius: {border_radius_a}; + color: {color_f}; +}} +QListView::item:hover {{ + background: {color_b}; +}} +QListView::item:selected {{ + background: {color_b}; +}} +/* Выделение в списке при фокусе на элементе */ +QListView::item:focus {{ + background: {color_a}; + color: {color_f}; +}} +QLineEdit {{ + background: {color_b}; + border: {border_c} rgba(255, 255, 255, 0.01); + border-radius: {border_radius_a}; + height: 34px; + padding-left: 12px; + color: {color_f}; + font-family: '{font_family}'; + font-size: {font_size_a}; +}} +QLineEdit:hover {{ + background: {color_c}; + border: {border_c} {color_a}; +}} +QLineEdit:focus {{ + border: {border_c} {color_a}; + background-color: {color_e}; +}} QTableWidget {{ background: {color_c}; color: {color_f}; @@ -1010,6 +1108,7 @@ QHeaderView::section {{ QTableWidget::item {{ padding: 8px; border-bottom: 1px solid {color_d}; + min-height: 36px; }} QTableWidget::item:selected {{ background: {color_a};