From 6fa145ee130044332ec146d2e53c8ab34eb46525 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Sun, 8 Jun 2025 23:36:01 +0500 Subject: [PATCH] feat: add styling to Context Menu Signed-off-by: Boris Yumankulov --- portprotonqt/context_menu_manager.py | 1 + portprotonqt/themes/standart/styles.py | 34 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/portprotonqt/context_menu_manager.py b/portprotonqt/context_menu_manager.py index 2918d1e..ad853c5 100644 --- a/portprotonqt/context_menu_manager.py +++ b/portprotonqt/context_menu_manager.py @@ -41,6 +41,7 @@ class ContextMenuManager: """ menu = QMenu(self.parent) + menu.setStyleSheet(self.theme.CONTEXT_MENU_STYLE) favorites = read_favorites() is_favorite = game_card.name in favorites diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 1467e6b..d66468a 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -8,6 +8,40 @@ current_theme_name = read_theme_from_config() favoriteLabelSize = 48, 48 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; + color: #ffffff; + font-family: 'Play'; + font-size: 16px; + padding: 5px; + } + QMenu::item { + padding: 8px 20px; + background: transparent; + border-radius: 8px; + color: #ffffff; + } + QMenu::item:selected { + background: #282a33; + color: #09bec8; + } + QMenu::item:hover { + background: #282a33; + color: #09bec8; + } + QMenu::item:focus { + background: #409EFF; + color: #ffffff; + border: 1px solid rgba(255, 255, 255, 0.3); + border-radius: 8px; + } +""" + # СТИЛЬ ШАПКИ ГЛАВНОГО ОКНА MAIN_WINDOW_HEADER_STYLE = """ QFrame {