From 748f9c886b20a3254e0ed15cdceec4716f065f32 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 14:33:37 +0700 Subject: [PATCH 01/20] add checkboxes styles --- portprotonqt/main_window.py | 3 ++- .../themes/standart/images/icons/check.svg | 1 + portprotonqt/themes/standart/styles.py | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 portprotonqt/themes/standart/images/icons/check.svg diff --git a/portprotonqt/main_window.py b/portprotonqt/main_window.py index b31f398..142f2ed 100644 --- a/portprotonqt/main_window.py +++ b/portprotonqt/main_window.py @@ -970,7 +970,7 @@ class MainWindow(QMainWindow): # 5. Fullscreen setting for application self.fullscreenCheckBox = QCheckBox(_("Launch Application in Fullscreen")) - #self.fullscreenCheckBox.setStyleSheet(self.theme.SETTINGS_CHECKBOX_STYLE) + self.fullscreenCheckBox.setStyleSheet(self.theme.SETTINGS_CHECKBOX_STYLE) self.fullscreenCheckBox.setFocusPolicy(Qt.FocusPolicy.StrongFocus) self.fullscreenTitle = QLabel(_("Application Fullscreen Mode:")) self.fullscreenTitle.setStyleSheet(self.theme.PARAMS_TITLE_STYLE) @@ -981,6 +981,7 @@ class MainWindow(QMainWindow): # 6. Automatic fullscreen on gamepad connection self.autoFullscreenGamepadCheckBox = QCheckBox(_("Auto Fullscreen on Gamepad connected")) + self.autoFullscreenGamepadCheckBox.setStyleSheet(self.theme.SETTINGS_CHECKBOX_STYLE) self.autoFullscreenGamepadCheckBox.setFocusPolicy(Qt.FocusPolicy.StrongFocus) self.autoFullscreenGamepadTitle = QLabel(_("Auto Fullscreen on Gamepad connected:")) self.autoFullscreenGamepadTitle.setStyleSheet(self.theme.PARAMS_TITLE_STYLE) diff --git a/portprotonqt/themes/standart/images/icons/check.svg b/portprotonqt/themes/standart/images/icons/check.svg new file mode 100644 index 0000000..cde32bd --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/check.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index f353ff8..1b92099 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -567,6 +567,26 @@ SETTINGS_COMBO_STYLE = f""" }} """ +SETTINGS_CHECKBOX_STYLE = """ + QCheckBox { + height: 34px; + } + + QCheckBox::indicator { + width: 24px; + height: 24px; + border: 1px solid rgba(255, 255, 255, 0.01); + border-radius: 10px; + background: #282a33; + } + QCheckBox::indicator:hover { + background: #3f424d; + border: 1px solid rgba(255, 255, 255, 0.2); + } + QCheckBox::indicator:checked { + image: url(./themes/standart/images/icons/check.svg); + } +""" # ФУНКЦИЯ ДЛЯ ДИНАМИЧЕСКОГО ГРАДИЕНТА (ДЕТАЛИ ИГР) # Функции из этой темы срабатывает всегда вне зависимости от выбранной темы, функции из других тем работают только в этих темах From 9f86eae5ef4a27961d6024ea04854bf46d2d4b20 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 15:13:46 +0700 Subject: [PATCH 02/20] fix focus styles for buttons, text fields & checkbox --- portprotonqt/themes/standart/styles.py | 28 +++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 1b92099..67b543b 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -187,7 +187,7 @@ INSTALLED_TAB_TITLE_STYLE = "font-family: 'Play'; font-size: 24px; color: #fffff ACTION_BUTTON_STYLE = """ QPushButton { background: #3f424d; - border: 1px solid rgba(255, 255, 255, 0.20); + border: 2px solid rgba(255, 255, 255, 0.01); border-radius: 10px; color: #ffffff; font-size: 16px; @@ -196,6 +196,7 @@ ACTION_BUTTON_STYLE = """ } QPushButton:hover { background: #282a33; + border: 2px solid #409EFF; } QPushButton:pressed { background: #282a33; @@ -465,7 +466,7 @@ PARAMS_TITLE_STYLE = "color: #ffffff; font-family: 'Play'; font-size: 16px; padd PROXY_INPUT_STYLE = """ QLineEdit { background: #282a33; - border: 0px solid rgba(255, 255, 255, 0.2); + border: 2px solid rgba(255, 255, 255, 0.01); border-radius: 10px; height: 34px; padding-left: 12px; @@ -473,8 +474,13 @@ PROXY_INPUT_STYLE = """ font-family: 'Play'; font-size: 16px; } + QLineEdit:hover { + background: #3f424d; + border: 2px solid #409EFF; + } QLineEdit:focus { - border: 1px solid rgba(255, 255, 255, 0.2); + border: 2px solid #409EFF; + background-color: #404554; } QMenu { border: 1px solid rgba(255, 255, 255, 0.2); @@ -494,7 +500,7 @@ PROXY_INPUT_STYLE = """ SETTINGS_COMBO_STYLE = f""" QComboBox {{ background: #3f424d; - border: 0px solid rgba(255, 255, 255, 0.2); + border: 2px solid rgba(255, 255, 255, 0.01); border-radius: 10px; height: 34px; padding-left: 12px; @@ -506,14 +512,14 @@ SETTINGS_COMBO_STYLE = f""" }} QComboBox:on {{ background: #373a43; - border: 1px solid rgba(255, 255, 255, 0.2); + border: 1px solid #409EFF; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; }} QComboBox:hover {{ - border: 1px solid rgba(255, 255, 255, 0.2); + border: 2px solid #409EFF; }} /* Состояние фокуса */ QComboBox:focus {{ @@ -543,7 +549,7 @@ SETTINGS_COMBO_STYLE = f""" /* Список при открытом комбобоксе */ QComboBox QAbstractItemView {{ outline: none; - border: 1px solid rgba(255, 255, 255, 0.2); + border: 1px solid #409EFF; border-top-style: none; }} QListView {{ @@ -575,16 +581,20 @@ SETTINGS_CHECKBOX_STYLE = """ QCheckBox::indicator { width: 24px; height: 24px; - border: 1px solid rgba(255, 255, 255, 0.01); + border: 2px solid rgba(255, 255, 255, 0.01); border-radius: 10px; background: #282a33; } QCheckBox::indicator:hover { background: #3f424d; - border: 1px solid rgba(255, 255, 255, 0.2); + border: 2px solid #409EFF; + } + QCheckBox::indicator:focus { + border: 2px solid #409EFF; } QCheckBox::indicator:checked { image: url(./themes/standart/images/icons/check.svg); + border: 2px solid #409EFF; } """ From 213709e88bc4649801d5763e6178725ba8a0c68c Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 15:37:45 +0700 Subject: [PATCH 03/20] add login icon --- portprotonqt/themes/standart/images/icons/login.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 portprotonqt/themes/standart/images/icons/login.svg diff --git a/portprotonqt/themes/standart/images/icons/login.svg b/portprotonqt/themes/standart/images/icons/login.svg new file mode 100644 index 0000000..8aafb9e --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/login.svg @@ -0,0 +1 @@ + From a4a3271df94d11462e2fd71b7a5727f870de8477 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 15:44:56 +0700 Subject: [PATCH 04/20] fix hardlink to checkbox icon --- portprotonqt/themes/standart/styles.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 67b543b..15f6c41 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -573,29 +573,29 @@ SETTINGS_COMBO_STYLE = f""" }} """ -SETTINGS_CHECKBOX_STYLE = """ - QCheckBox { +SETTINGS_CHECKBOX_STYLE = f""" + QCheckBox {{ height: 34px; - } + }} - QCheckBox::indicator { + QCheckBox::indicator {{ width: 24px; height: 24px; border: 2px solid rgba(255, 255, 255, 0.01); border-radius: 10px; background: #282a33; - } - QCheckBox::indicator:hover { + }} + QCheckBox::indicator:hover {{ background: #3f424d; border: 2px solid #409EFF; - } - QCheckBox::indicator:focus { + }} + QCheckBox::indicator:focus {{ border: 2px solid #409EFF; - } - QCheckBox::indicator:checked { - image: url(./themes/standart/images/icons/check.svg); + }} + QCheckBox::indicator:checked {{ + image: url({theme_manager.get_icon("check", current_theme_name, as_path=True)}); border: 2px solid #409EFF; - } + }} """ # ФУНКЦИЯ ДЛЯ ДИНАМИЧЕСКОГО ГРАДИЕНТА (ДЕТАЛИ ИГР) From 79e2ad19973ffa6ebdfb6a2c43cc4862e5cf3186 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 15:50:24 +0700 Subject: [PATCH 05/20] change nav buttons focus color --- portprotonqt/themes/standart/styles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 15f6c41..ae0fca2 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -53,14 +53,14 @@ NAV_BUTTON_STYLE = """ } NavLabel[checked = true] { background: rgba(0,122,255,0); - color: #09bec8; + color: #409EFF; font-weight: normal; text-decoration: underline; border-radius: 15px; } NavLabel:hover { background: none; - color: #09bec8; + color: #409EFF; } """ From 186ee048f79931d789c57c770ab43422f2145845 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 15:58:03 +0700 Subject: [PATCH 06/20] add background color to NAV_WIDGET_STYLE --- portprotonqt/themes/standart/styles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index ae0fca2..31c201d 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -33,7 +33,7 @@ TITLE_LABEL_STYLE = """ # СТИЛЬ ОБЛАСТИ НАВИГАЦИИ (КНОПКИ ВКЛАДОК) NAV_WIDGET_STYLE = """ QWidget { - background: none; + background: #282a33; border: 0px solid; } """ @@ -48,7 +48,7 @@ NAV_BUTTON_STYLE = """ font-family: 'Play'; font-size: 16px; text-transform: uppercase; - border: none; + border: #409EFF; border-radius: 15px; } NavLabel[checked = true] { From 09066521e8414da1d2bc3002319809f70ff01ea8 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 16:25:39 +0700 Subject: [PATCH 07/20] add epic games & gog icons --- portprotonqt/themes/standart/images/icons/epic_games.svg | 1 + portprotonqt/themes/standart/images/icons/gog.svg | 1 + 2 files changed, 2 insertions(+) create mode 100644 portprotonqt/themes/standart/images/icons/epic_games.svg create mode 100644 portprotonqt/themes/standart/images/icons/gog.svg diff --git a/portprotonqt/themes/standart/images/icons/epic_games.svg b/portprotonqt/themes/standart/images/icons/epic_games.svg new file mode 100644 index 0000000..db4fe7f --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/epic_games.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/gog.svg b/portprotonqt/themes/standart/images/icons/gog.svg new file mode 100644 index 0000000..bb05fb7 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/gog.svg @@ -0,0 +1 @@ + From 337db174671f2d9caddd34339ba276b06c24368b Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 16:41:43 +0700 Subject: [PATCH 08/20] add areweanticheat status icons --- portprotonqt/themes/standart/images/icons/ac_broken.svg | 1 + portprotonqt/themes/standart/images/icons/ac_denied.svg | 1 + portprotonqt/themes/standart/images/icons/ac_planned.svg | 1 + portprotonqt/themes/standart/images/icons/ac_running.svg | 1 + portprotonqt/themes/standart/images/icons/ac_supported.svg | 1 + 5 files changed, 5 insertions(+) create mode 100644 portprotonqt/themes/standart/images/icons/ac_broken.svg create mode 100644 portprotonqt/themes/standart/images/icons/ac_denied.svg create mode 100644 portprotonqt/themes/standart/images/icons/ac_planned.svg create mode 100644 portprotonqt/themes/standart/images/icons/ac_running.svg create mode 100644 portprotonqt/themes/standart/images/icons/ac_supported.svg diff --git a/portprotonqt/themes/standart/images/icons/ac_broken.svg b/portprotonqt/themes/standart/images/icons/ac_broken.svg new file mode 100644 index 0000000..864d1d7 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/ac_broken.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/ac_denied.svg b/portprotonqt/themes/standart/images/icons/ac_denied.svg new file mode 100644 index 0000000..b1f4838 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/ac_denied.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/ac_planned.svg b/portprotonqt/themes/standart/images/icons/ac_planned.svg new file mode 100644 index 0000000..7564070 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/ac_planned.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/ac_running.svg b/portprotonqt/themes/standart/images/icons/ac_running.svg new file mode 100644 index 0000000..cdcaf8f --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/ac_running.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/ac_supported.svg b/portprotonqt/themes/standart/images/icons/ac_supported.svg new file mode 100644 index 0000000..df30dc4 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/ac_supported.svg @@ -0,0 +1 @@ + From db95120b87751b941ee346c4cbf5b47918fc9732 Mon Sep 17 00:00:00 2001 From: dervart Date: Thu, 12 Jun 2025 16:50:45 +0700 Subject: [PATCH 09/20] change addgame, play, find_games hover color --- portprotonqt/themes/standart/styles.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 31c201d..b34d6ca 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -86,7 +86,7 @@ SEARCH_EDIT_STYLE = """ color: #ffffff; } QLineEdit:focus { - border: 1px solid #09bec8; + border: 1px solid #409EFF; } """ @@ -269,10 +269,10 @@ ADDGAME_BACK_BUTTON_STYLE = """ padding: 8px 16px; } QPushButton:hover { - background: #09bec8; + background: #409EFF; } QPushButton:pressed { - background: #09bec8; + background: #409EFF; } """ @@ -326,10 +326,10 @@ PLAY_BUTTON_STYLE = """ min-height: 40px; } QPushButton:hover { - background: #09bec8; + background: #409EFF; } QPushButton:pressed { - background: #09bec8; + background: #409EFF; } """ From bff5e456cf237c5ec1976fa86e256238825d15a6 Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 09:30:43 +0700 Subject: [PATCH 10/20] change ACTION_BUTTON_STYLE style --- portprotonqt/themes/standart/styles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 9e9b288..8c524e4 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -236,7 +236,7 @@ ACTION_BUTTON_STYLE = """ padding: 8px 16px; } QPushButton:hover { - background: #282a33; + background: #409EFF; border: 2px solid #409EFF; } QPushButton:pressed { From 568120fb0e1cc026b54be3ef040043c2f09fad95 Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 10:55:01 +0700 Subject: [PATCH 11/20] add icons for system_overlay --- portprotonqt/themes/standart/images/icons/cancel.svg | 1 + portprotonqt/themes/standart/images/icons/desktop.svg | 1 + portprotonqt/themes/standart/images/icons/exit.svg | 1 + portprotonqt/themes/standart/images/icons/reboot.svg | 1 + portprotonqt/themes/standart/images/icons/shutdown.svg | 1 + .../standart/images/icons/{spinner.svg => suspend.svg} | 0 portprotonqt/themes/standart/styles.py | 8 +++++--- 7 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 portprotonqt/themes/standart/images/icons/cancel.svg create mode 100644 portprotonqt/themes/standart/images/icons/desktop.svg create mode 100644 portprotonqt/themes/standart/images/icons/exit.svg create mode 100644 portprotonqt/themes/standart/images/icons/reboot.svg create mode 100644 portprotonqt/themes/standart/images/icons/shutdown.svg rename portprotonqt/themes/standart/images/icons/{spinner.svg => suspend.svg} (100%) diff --git a/portprotonqt/themes/standart/images/icons/cancel.svg b/portprotonqt/themes/standart/images/icons/cancel.svg new file mode 100644 index 0000000..cb6e680 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/cancel.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/desktop.svg b/portprotonqt/themes/standart/images/icons/desktop.svg new file mode 100644 index 0000000..8323ac3 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/desktop.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/exit.svg b/portprotonqt/themes/standart/images/icons/exit.svg new file mode 100644 index 0000000..4156042 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/exit.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/reboot.svg b/portprotonqt/themes/standart/images/icons/reboot.svg new file mode 100644 index 0000000..9163861 --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/reboot.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/shutdown.svg b/portprotonqt/themes/standart/images/icons/shutdown.svg new file mode 100644 index 0000000..69aa61e --- /dev/null +++ b/portprotonqt/themes/standart/images/icons/shutdown.svg @@ -0,0 +1 @@ + diff --git a/portprotonqt/themes/standart/images/icons/spinner.svg b/portprotonqt/themes/standart/images/icons/suspend.svg similarity index 100% rename from portprotonqt/themes/standart/images/icons/spinner.svg rename to portprotonqt/themes/standart/images/icons/suspend.svg diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 8c524e4..8a66e20 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -252,21 +252,23 @@ ACTION_BUTTON_STYLE = """ OVERLAY_BUTTON_STYLE = """ QPushButton { background: #3f424d; - border: 1px solid rgba(255, 255, 255, 0.20); + border: 2px solid rgba(255, 255, 255, 0.01); border-radius: 10px; color: #ffffff; font-size: 16px; font-family: 'Play'; + padding: 8px 16px; } QPushButton:hover { - background: #282a33; + background: #409EFF; + border: 2px solid #409EFF; } QPushButton:pressed { background: #282a33; } QPushButton:focus { border: 2px solid #409EFF; - background-color: #404554; + background-color: #409EFF; } """ From fbe8d87b3ddcc718b9fc16cb58863f3ee3be2c8a Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 10:56:39 +0700 Subject: [PATCH 12/20] system_overlay change from QPushButton to AutoSizeButton --- portprotonqt/system_overlay.py | 40 +++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/portprotonqt/system_overlay.py b/portprotonqt/system_overlay.py index 6359dce..3f7d6ee 100644 --- a/portprotonqt/system_overlay.py +++ b/portprotonqt/system_overlay.py @@ -5,6 +5,8 @@ from PySide6.QtCore import Qt from portprotonqt.logger import get_logger import os from portprotonqt.localization import _ +from portprotonqt.custom_widgets import AutoSizeButton +from portprotonqt.theme_manager import ThemeManager logger = get_logger(__name__) @@ -16,41 +18,63 @@ class SystemOverlay(QDialog): self.setWindowTitle(_("System Overlay")) self.setModal(True) self.setFixedSize(400, 300) + self.theme_manager = ThemeManager() + # self.setWindowFlags(Qt.FramelessWindowHint) layout = QVBoxLayout(self) layout.setContentsMargins(20, 20, 20, 20) layout.setSpacing(10) # Reboot button - reboot_button = QPushButton(_("Reboot")) + # reboot_button = QPushButton(_("Reboot")) + reboot_button = AutoSizeButton( + _("Reboot"), + icon=self.theme_manager.get_icon("reboot") + ) reboot_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE) reboot_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus) reboot_button.clicked.connect(self.reboot) layout.addWidget(reboot_button) # Shutdown button - shutdown_button = QPushButton(_("Shutdown")) + # shutdown_button = QPushButton(_("Shutdown")) + shutdown_button = AutoSizeButton( + _("Shutdown"), + icon=self.theme_manager.get_icon("shutdown") + ) shutdown_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE) shutdown_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus) shutdown_button.clicked.connect(self.shutdown) layout.addWidget(shutdown_button) # Suspend button - suspend_button = QPushButton(_("Suspend")) + # suspend_button = QPushButton(_("Suspend")) + suspend_button = AutoSizeButton( + _("Suspend"), + icon=self.theme_manager.get_icon("suspend") + ) suspend_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE) suspend_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus) suspend_button.clicked.connect(self.suspend) layout.addWidget(suspend_button) # Exit application button - exit_button = QPushButton(_("Exit Application")) + # exit_button = QPushButton(_("Exit Application")) + exit_button = AutoSizeButton( + _("Exit Application"), + icon=self.theme_manager.get_icon("exit") + ) exit_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE) exit_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus) exit_button.clicked.connect(self.exit_application) layout.addWidget(exit_button) # Return to Desktop button - desktop_button = QPushButton(_("Return to Desktop")) + # desktop_button = QPushButton(_("Return to Desktop")) + desktop_button = AutoSizeButton( + _("Return to Desktop"), + icon=self.theme_manager.get_icon("desktop") + ) desktop_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE) desktop_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus) desktop_button.clicked.connect(self.return_to_desktop) @@ -62,7 +86,11 @@ class SystemOverlay(QDialog): layout.addWidget(desktop_button) # Cancel button - cancel_button = QPushButton(_("Cancel")) + # cancel_button = QPushButton(_("Cancel")) + cancel_button = AutoSizeButton( + _("Cancel"), + icon=self.theme_manager.get_icon("cancel") + ) cancel_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE) cancel_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus) cancel_button.clicked.connect(self.reject) From 120f2a5590d9673fff7739b27551722b9cab09ce Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 11:04:17 +0700 Subject: [PATCH 13/20] change color of icons for areweanticheat --- portprotonqt/themes/standart/images/icons/ac_broken.svg | 2 +- portprotonqt/themes/standart/images/icons/ac_denied.svg | 2 +- portprotonqt/themes/standart/images/icons/ac_planned.svg | 2 +- portprotonqt/themes/standart/images/icons/ac_running.svg | 2 +- portprotonqt/themes/standart/images/icons/ac_supported.svg | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/portprotonqt/themes/standart/images/icons/ac_broken.svg b/portprotonqt/themes/standart/images/icons/ac_broken.svg index 864d1d7..3ae1e8a 100644 --- a/portprotonqt/themes/standart/images/icons/ac_broken.svg +++ b/portprotonqt/themes/standart/images/icons/ac_broken.svg @@ -1 +1 @@ - + diff --git a/portprotonqt/themes/standart/images/icons/ac_denied.svg b/portprotonqt/themes/standart/images/icons/ac_denied.svg index b1f4838..f4550bc 100644 --- a/portprotonqt/themes/standart/images/icons/ac_denied.svg +++ b/portprotonqt/themes/standart/images/icons/ac_denied.svg @@ -1 +1 @@ - + diff --git a/portprotonqt/themes/standart/images/icons/ac_planned.svg b/portprotonqt/themes/standart/images/icons/ac_planned.svg index 7564070..8edaa81 100644 --- a/portprotonqt/themes/standart/images/icons/ac_planned.svg +++ b/portprotonqt/themes/standart/images/icons/ac_planned.svg @@ -1 +1 @@ - + diff --git a/portprotonqt/themes/standart/images/icons/ac_running.svg b/portprotonqt/themes/standart/images/icons/ac_running.svg index cdcaf8f..5fad41a 100644 --- a/portprotonqt/themes/standart/images/icons/ac_running.svg +++ b/portprotonqt/themes/standart/images/icons/ac_running.svg @@ -1 +1 @@ - + diff --git a/portprotonqt/themes/standart/images/icons/ac_supported.svg b/portprotonqt/themes/standart/images/icons/ac_supported.svg index df30dc4..f76efd0 100644 --- a/portprotonqt/themes/standart/images/icons/ac_supported.svg +++ b/portprotonqt/themes/standart/images/icons/ac_supported.svg @@ -1 +1 @@ - + From 0c7cb0092bf96650c68a1a89c8e01f15ea570222 Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 11:11:32 +0700 Subject: [PATCH 14/20] change getAntiCheatIconFilename --- portprotonqt/game_card.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portprotonqt/game_card.py b/portprotonqt/game_card.py index 8ad4a20..54ce23b 100644 --- a/portprotonqt/game_card.py +++ b/portprotonqt/game_card.py @@ -323,9 +323,9 @@ class GameCard(QFrame): def getAntiCheatIconFilename(status: str) -> str: status = status.lower() if status in ("supported", "running"): - return "platinum-gold" + return "ac_supported" elif status in ("denied", "planned", "broken"): - return "broken" + return "ac_broken" return "" @staticmethod From a1bdff73fe6f031ba1a93fcded3e062f224b2b4a Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 11:21:57 +0700 Subject: [PATCH 15/20] getAntiCheatIconFilename expand the list of status --- portprotonqt/game_card.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/portprotonqt/game_card.py b/portprotonqt/game_card.py index 54ce23b..ca95cfd 100644 --- a/portprotonqt/game_card.py +++ b/portprotonqt/game_card.py @@ -322,9 +322,15 @@ class GameCard(QFrame): @staticmethod def getAntiCheatIconFilename(status: str) -> str: status = status.lower() - if status in ("supported", "running"): + if status in ("supported"): return "ac_supported" - elif status in ("denied", "planned", "broken"): + elif status in ("running"): + return "ac_running" + elif status in ("planned"): + return "ac_planned" + elif status in ("denied"): + return "ac_denied" + elif status in ("broken"): return "ac_broken" return "" From bad91fed4ef4acc387e2fcfb0b92bed019ab82f8 Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 11:44:20 +0700 Subject: [PATCH 16/20] dialogs.py add input styles --- portprotonqt/dialogs.py | 6 ++--- portprotonqt/themes/standart/styles.py | 34 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/portprotonqt/dialogs.py b/portprotonqt/dialogs.py index a77fc5b..00ccbf4 100644 --- a/portprotonqt/dialogs.py +++ b/portprotonqt/dialogs.py @@ -98,7 +98,7 @@ class AddGameDialog(QDialog): # Game name self.nameEdit = QLineEdit(self) - self.nameEdit.setStyleSheet(self.theme.SEARCH_EDIT_STYLE + " QLineEdit { color: #ffffff; font-size: 14px; }") + self.nameEdit.setStyleSheet(self.theme.ADDGAME_INPUT_STYLE) if game_name: self.nameEdit.setText(game_name) name_label = QLabel(_("Game Name:")) @@ -107,7 +107,7 @@ class AddGameDialog(QDialog): # Exe path self.exeEdit = QLineEdit(self) - self.exeEdit.setStyleSheet(self.theme.SEARCH_EDIT_STYLE + " QLineEdit { color: #ffffff; font-size: 14px; }") + self.exeEdit.setStyleSheet(self.theme.ADDGAME_INPUT_STYLE) if exe_path: self.exeEdit.setText(exe_path) exeBrowseButton = QPushButton(_("Browse..."), self) @@ -123,7 +123,7 @@ class AddGameDialog(QDialog): # Cover path self.coverEdit = QLineEdit(self) - self.coverEdit.setStyleSheet(self.theme.SEARCH_EDIT_STYLE + " QLineEdit { color: #ffffff; font-size: 14px; }") + self.coverEdit.setStyleSheet(self.theme.ADDGAME_INPUT_STYLE) if cover_path: self.coverEdit.setText(cover_path) coverBrowseButton = QPushButton(_("Browse..."), self) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 8a66e20..ed477c3 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -419,6 +419,40 @@ DIALOG_BROWSE_BUTTON_STYLE = """ } """ +ADDGAME_INPUT_STYLE = """ + QLineEdit { + background: #3f424d; + border: 2px solid rgba(255, 255, 255, 0.01); + border-radius: 10px; + height: 34px; + padding-left: 12px; + color: #ffffff; + font-family: 'Play'; + font-size: 16px; + } + QLineEdit:hover { + background: #3f424d; + border: 2px solid #409EFF; + } + QLineEdit:focus { + border: 2px solid #409EFF; + background-color: #404554; + } + QMenu { + border: 1px solid rgba(255, 255, 255, 0.2); + padding: 5px 10px; + background: #32343d; + } + QMenu::item { + padding: 0px 10px; + border: 10px solid transparent; /* reserve space for selection border */ + } + QMenu::item:selected { + background: #3f424d; + border-radius: 10px; + } +""" + # СТИЛЬ КАРТОЧКИ ИГРЫ (GAMECARD) GAME_CARD_WINDOW_STYLE = """ QFrame { From 997e66afa6fd20120cae260c5bbacde248a571dc Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 17:36:27 +0700 Subject: [PATCH 17/20] system_overlay now borderless thanks to @Vector_null --- portprotonqt/system_overlay.py | 27 +++++++++++++++++--------- portprotonqt/themes/standart/styles.py | 3 ++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/portprotonqt/system_overlay.py b/portprotonqt/system_overlay.py index 3f7d6ee..1e49be6 100644 --- a/portprotonqt/system_overlay.py +++ b/portprotonqt/system_overlay.py @@ -19,14 +19,16 @@ class SystemOverlay(QDialog): self.setModal(True) self.setFixedSize(400, 300) self.theme_manager = ThemeManager() - # self.setWindowFlags(Qt.FramelessWindowHint) + self.setStyleSheet(self.theme.OVERLAY_WINDOW_STYLE) + + # Убираем рамку окна + self.setWindowFlags(Qt.WindowType.FramelessWindowHint | Qt.WindowType.Dialog) layout = QVBoxLayout(self) layout.setContentsMargins(20, 20, 20, 20) layout.setSpacing(10) # Reboot button - # reboot_button = QPushButton(_("Reboot")) reboot_button = AutoSizeButton( _("Reboot"), icon=self.theme_manager.get_icon("reboot") @@ -37,7 +39,6 @@ class SystemOverlay(QDialog): layout.addWidget(reboot_button) # Shutdown button - # shutdown_button = QPushButton(_("Shutdown")) shutdown_button = AutoSizeButton( _("Shutdown"), icon=self.theme_manager.get_icon("shutdown") @@ -48,7 +49,6 @@ class SystemOverlay(QDialog): layout.addWidget(shutdown_button) # Suspend button - # suspend_button = QPushButton(_("Suspend")) suspend_button = AutoSizeButton( _("Suspend"), icon=self.theme_manager.get_icon("suspend") @@ -59,7 +59,6 @@ class SystemOverlay(QDialog): layout.addWidget(suspend_button) # Exit application button - # exit_button = QPushButton(_("Exit Application")) exit_button = AutoSizeButton( _("Exit Application"), icon=self.theme_manager.get_icon("exit") @@ -70,7 +69,6 @@ class SystemOverlay(QDialog): layout.addWidget(exit_button) # Return to Desktop button - # desktop_button = QPushButton(_("Return to Desktop")) desktop_button = AutoSizeButton( _("Return to Desktop"), icon=self.theme_manager.get_icon("desktop") @@ -86,7 +84,6 @@ class SystemOverlay(QDialog): layout.addWidget(desktop_button) # Cancel button - # cancel_button = QPushButton(_("Cancel")) cancel_button = AutoSizeButton( _("Cancel"), icon=self.theme_manager.get_icon("cancel") @@ -96,8 +93,20 @@ class SystemOverlay(QDialog): cancel_button.clicked.connect(self.reject) layout.addWidget(cancel_button) - # Set focus to the first button - reboot_button.setFocus() + def showEvent(self, event): + """Переопределяем showEvent для центрирования окна и установки фокуса""" + super().showEvent(event) + + # Центрируем окно относительно родителя или экрана + if self.parent(): + self.move(self.parent().geometry().center() - self.rect().center()) + else: + screen_geometry = QApplication.primaryScreen().availableGeometry() + self.move(screen_geometry.center() - self.rect().center()) + + # Устанавливаем фокус на первый элемент + self.setFocus() + self.findChild(QPushButton).setFocus() def reboot(self): try: diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index ed477c3..7842ce2 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -248,7 +248,8 @@ ACTION_BUTTON_STYLE = """ } """ -# СТИЛЬ КНОПОК ОВЕРЛЕЯ +# СТИЛЬ ОВЕРЛЕЯ +OVERLAY_WINDOW_STYLE = "background: #282a33;" OVERLAY_BUTTON_STYLE = """ QPushButton { background: #3f424d; From 2ce41697efb48b036c2158f42cf33994e5100742 Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 17:50:36 +0700 Subject: [PATCH 18/20] changed context_menu_style --- portprotonqt/themes/standart/styles.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 7842ce2..8847a85 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -10,11 +10,7 @@ pixmapsScaledSize = 60, 60 CONTEXT_MENU_STYLE = """ QMenu { - background: qlineargradient(x1:0, y1:0, x2:1, y2:0, - stop:0 rgba(40, 40, 40, 0.95), - stop:1 rgba(25, 25, 25, 0.95)); - border: 1px solid rgba(255, 255, 255, 0.15); - border-radius: 12px; + background: #282a33;; color: #ffffff; font-family: 'Play'; font-size: 16px; @@ -27,12 +23,12 @@ CONTEXT_MENU_STYLE = """ color: #ffffff; } QMenu::item:selected { - background: #282a33; - color: #09bec8; + background: #409EFF; + color: #ffffff; } QMenu::item:hover { - background: #282a33; - color: #09bec8; + background: #409EFF; + color: #ffffff; } QMenu::item:focus { background: #409EFF; @@ -244,7 +240,7 @@ ACTION_BUTTON_STYLE = """ } QPushButton:focus { border: 2px solid #409EFF; - background-color: #404554; + background-color: #409EFF; } """ From e9ecb466b258511a7574dcbb09b525e7e5f7c1d4 Mon Sep 17 00:00:00 2001 From: dervart Date: Fri, 13 Jun 2025 18:09:06 +0700 Subject: [PATCH 19/20] combobox styles for hover & focus --- portprotonqt/themes/standart/styles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 8847a85..a09f49d 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -641,11 +641,12 @@ SETTINGS_COMBO_STYLE = f""" }} QComboBox:hover {{ border: 2px solid #409EFF; + background: #409EFF; }} /* Состояние фокуса */ QComboBox:focus {{ border: 2px solid #409EFF; - background-color: #404554; + background-color: #409EFF; }} QComboBox::drop-down {{ subcontrol-origin: padding; From f105af01effc58ad9293a5a06f90ee231e13eb61 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Fri, 13 Jun 2025 17:43:49 +0500 Subject: [PATCH 20/20] fix: resolve Pyright type errors in SystemOverlay class Signed-off-by: Boris Yumankulov --- portprotonqt/system_overlay.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/portprotonqt/system_overlay.py b/portprotonqt/system_overlay.py index 1e49be6..7e5c845 100644 --- a/portprotonqt/system_overlay.py +++ b/portprotonqt/system_overlay.py @@ -1,6 +1,5 @@ import subprocess -from PySide6.QtWidgets import QDialog, QVBoxLayout, QPushButton, QMessageBox -from PySide6.QtWidgets import QApplication +from PySide6.QtWidgets import QDialog, QVBoxLayout, QPushButton, QMessageBox, QApplication, QWidget from PySide6.QtCore import Qt from portprotonqt.logger import get_logger import os @@ -94,19 +93,21 @@ class SystemOverlay(QDialog): layout.addWidget(cancel_button) def showEvent(self, event): - """Переопределяем showEvent для центрирования окна и установки фокуса""" + """Override showEvent to center window and set focus.""" super().showEvent(event) - # Центрируем окно относительно родителя или экрана - if self.parent(): - self.move(self.parent().geometry().center() - self.rect().center()) + # Center window relative to parent or screen + parent = self.parent() + if isinstance(parent, QWidget) and parent.isVisible(): + self.move(parent.geometry().center() - self.rect().center()) else: screen_geometry = QApplication.primaryScreen().availableGeometry() self.move(screen_geometry.center() - self.rect().center()) - # Устанавливаем фокус на первый элемент - self.setFocus() - self.findChild(QPushButton).setFocus() + # Set focus on first button + button = self.findChild(QPushButton) + if button is not None: + button.setFocus() def reboot(self): try: