From 17262f6c9f32930c07fd7bef640bfdbf10972d31 Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 7 Nov 2025 12:17:36 +0700 Subject: [PATCH 1/3] Play Button & Settings Button in row --- portprotonqt/main_window.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/portprotonqt/main_window.py b/portprotonqt/main_window.py index 667a41a..93efa6f 100644 --- a/portprotonqt/main_window.py +++ b/portprotonqt/main_window.py @@ -2642,6 +2642,7 @@ class MainWindow(QMainWindow): file_to_check = entry_exec_split[0] current_exe = os.path.basename(file_to_check) if file_to_check else None + buttons_layout = QHBoxLayout() if self.target_exe is not None and current_exe == self.target_exe: playButton = AutoSizeButton(_("Stop"), icon=self.theme_manager.get_icon("stop")) else: @@ -2650,7 +2651,7 @@ class MainWindow(QMainWindow): playButton.setFixedSize(120, 40) playButton.setStyleSheet(self.theme.PLAY_BUTTON_STYLE) playButton.clicked.connect(lambda: self.toggleGame(exec_line, playButton)) - detailsLayout.addWidget(playButton, alignment=Qt.AlignmentFlag.AlignLeft) + buttons_layout.addWidget(playButton, alignment=Qt.AlignmentFlag.AlignLeft) # Settings button settings_icon = self.theme_manager.get_icon("settings") @@ -2658,7 +2659,9 @@ class MainWindow(QMainWindow): settings_button.setFixedSize(120, 40) settings_button.setStyleSheet(self.theme.PLAY_BUTTON_STYLE) settings_button.clicked.connect(lambda: self.open_exe_settings(file_to_check)) - detailsLayout.addWidget(settings_button, alignment=Qt.AlignmentFlag.AlignLeft) + buttons_layout.addWidget(settings_button, alignment=Qt.AlignmentFlag.AlignLeft) + buttons_layout.addStretch() + detailsLayout.addLayout(buttons_layout) contentFrameLayout.addWidget(detailsWidget) mainLayout.addStretch() -- 2.49.1 From ea272c29b621a7662ca9d463210e43d0087683c9 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 13 Nov 2025 15:43:13 +0700 Subject: [PATCH 2/3] 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}; -- 2.49.1 From 2e8be1343711fc24dc2c04256a3d0b672f5d979a Mon Sep 17 00:00:00 2001 From: dervart Date: Sat, 15 Nov 2025 16:22:59 +0700 Subject: [PATCH 3/3] WINETRICKS_TABBLE_STYLE more fixes --- portprotonqt/dialogs.py | 14 +++++- portprotonqt/themes/standart/styles.py | 65 ++++++++++++++++++-------- 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/portprotonqt/dialogs.py b/portprotonqt/dialogs.py index c61a605..42a0fd5 100644 --- a/portprotonqt/dialogs.py +++ b/portprotonqt/dialogs.py @@ -1325,7 +1325,9 @@ class WinetricksDialog(QDialog): # DLLs tab self.dll_table = QTableWidget() + self.dll_table.setAlternatingRowColors(True) self.dll_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + # self.dll_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) self.dll_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) self.dll_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection) self.dll_table.setColumnCount(3) @@ -1356,7 +1358,9 @@ class WinetricksDialog(QDialog): # Fonts tab self.fonts_table = QTableWidget() + self.fonts_table.setAlternatingRowColors(True) self.fonts_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + # self.fonts_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) self.fonts_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) self.fonts_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection) self.fonts_table.setColumnCount(3) @@ -1387,7 +1391,9 @@ class WinetricksDialog(QDialog): # Settings tab self.settings_table = QTableWidget() + self.settings_table.setAlternatingRowColors(True) self.settings_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + # self.settings_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) self.settings_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) self.settings_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection) self.settings_table.setColumnCount(3) @@ -1703,7 +1709,7 @@ class ExeSettingsDialog(QDialog): self.setWindowTitle(_("Exe Settings")) self.setModal(True) - self.resize(900, 600) + self.resize(1100, 720) self.setStyleSheet(self.theme.MAIN_WINDOW_STYLE + self.theme.MESSAGE_BOX_STYLE) self.init_toggle_settings() @@ -1794,7 +1800,9 @@ class ExeSettingsDialog(QDialog): # Таблица настроек self.settings_table = QTableWidget() + self.settings_table.setAlternatingRowColors(True) self.settings_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + # self.settings_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) self.settings_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) self.settings_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection) self.settings_table.setColumnCount(3) @@ -1811,9 +1819,11 @@ class ExeSettingsDialog(QDialog): # Таблица Advanced self.advanced_table = QTableWidget() + self.advanced_table.setAlternatingRowColors(True) self.advanced_table.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + self.advanced_table.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) self.advanced_table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) - self.advanced_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection) + # self.advanced_table.setSelectionMode(QAbstractItemView.SelectionMode.SingleSelection) self.advanced_table.setColumnCount(3) self.advanced_table.setHorizontalHeaderLabels([_("Setting"), _("Value"), _("Description")]) self.advanced_table.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeMode.ResizeToContents) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index bc278cb..65325a4 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -968,9 +968,8 @@ SETTINGS_CHECKBOX_STYLE = f""" WINETRICKS_TAB_STYLE = f""" QTabWidget::pane {{ - border: 1px solid {color_d}; - background: {color_b}; - border-radius: {border_radius_a}; + border-top: 1px solid {color_c}; + background: {color_h}; }} QTabBar::tab {{ background: {color_c}; @@ -985,7 +984,7 @@ QTabBar::tab:selected {{ color: {color_f}; }} QTabBar::tab:hover {{ - background: {color_e}; + background: {color_a}; }} """ @@ -1071,7 +1070,7 @@ QListView::item:focus {{ color: {color_f}; }} QLineEdit {{ - background: {color_b}; + background: {color_c}; border: {border_c} rgba(255, 255, 255, 0.01); border-radius: {border_radius_a}; height: 34px; @@ -1089,9 +1088,9 @@ QLineEdit:focus {{ background-color: {color_e}; }} QTableWidget {{ - background: {color_c}; + background: {color_h}; color: {color_f}; - gridline-color: {color_d}; + gridline-color: {color_h}; alternate-background-color: {color_d}; border: {border_a}; border-radius: {border_radius_a}; @@ -1107,40 +1106,68 @@ QHeaderView::section {{ }} QTableWidget::item {{ padding: 8px; - border-bottom: 1px solid {color_d}; - min-height: 36px; + border-bottom: {border_a } {color_c}; + height: 36px; }} -QTableWidget::item:selected {{ +QTableWidget::item:selected, +QTableWidget::item:focus, +QTableWidget::item:selected:focus {{ background: {color_a}; color: {color_f}; + selection-background-color: {color_a}; }} QTableWidget::item:hover {{ - background: {color_e}; + background: {color_h}; }} QTableWidget::indicator {{ width: 24px; height: 24px; - border: {border_b} {color_a}; + border: {border_c} {color_h}; border-radius: {border_radius_a}; - background: rgba(255, 255, 255, 0.1); + background: {color_b}; }} QTableWidget::indicator:unchecked {{ background: rgba(255, 255, 255, 0.1); image: none; }} QTableWidget::indicator:checked {{ - background: {color_a}; + background: {color_b}; image: url({theme_manager.get_icon("check", current_theme_name, as_path=True)}); - border: {border_b} {color_f}; + border: {border_c} {color_a}; }} QTableWidget::indicator:hover {{ background: rgba(255, 255, 255, 0.2); - border: {border_b} {color_a}; -}} -QTableWidget::indicator:focus {{ border: {border_c} {color_a}; }} -{SCROLL_AREA_STYLE} +QTableWidget::indicator:focus {{ + background: rgba(255, 255, 255, 0.2); + border: {border_c} {color_a}; +}} +QScrollBar:vertical {{ + width: 10px; + border: {border_a}; + border-radius: 5px; + background: rgba(20, 20, 20, 0.30); +}} +QScrollBar::handle:vertical {{ + background: #bebebe; + border: {border_a}; + border-radius: 5px; +}} +QScrollBar::add-line:vertical {{ + border: {border_a}; + background: none; +}} +QScrollBar::sub-line:vertical {{ + border: {border_a}; + background: none; +}} +QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {{ + border: {border_a}; + width: 3px; + height: 3px; + background: none; +}} """ WINETRICKS_LOG_STYLE = f""" -- 2.49.1