diff --git a/portprotonqt/context_menu_manager.py b/portprotonqt/context_menu_manager.py index 106edf83..d70b4c8d 100644 --- a/portprotonqt/context_menu_manager.py +++ b/portprotonqt/context_menu_manager.py @@ -137,6 +137,8 @@ class ContextMenuManager: return menu = QMenu(file_explorer) + menu.setWindowFlags(menu.windowFlags() | Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint) + menu.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) menu.setStyleSheet(self.theme.CONTEXT_MENU_STYLE) menu.setParent(file_explorer, Qt.WindowType.Popup) # Set transientParent for Wayland @@ -362,6 +364,8 @@ class ContextMenuManager: pos: The position (in widget coordinates) where the menu should appear. """ menu = QMenu(self.parent) + menu.setWindowFlags(menu.windowFlags() | Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint) + menu.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) menu.setStyleSheet(self.theme.CONTEXT_MENU_STYLE) # For non-Steam games, check if exe exists @@ -1261,6 +1265,8 @@ def show_themed_line_edit_context_menu(line_edit: QLineEdit, global_pos: QPoint, action.setEnabled(enabled) menu = QMenu(line_edit) + menu.setWindowFlags(menu.windowFlags() | Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint) + menu.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) current_theme = theme if theme is not None else getattr(line_edit, "theme", None) if current_theme and hasattr(current_theme, "CONTEXT_MENU_STYLE"): menu.setStyleSheet(current_theme.CONTEXT_MENU_STYLE) diff --git a/portprotonqt/dialogs/settings_dialog.py b/portprotonqt/dialogs/settings_dialog.py index 7080d275..59b9ab7a 100644 --- a/portprotonqt/dialogs/settings_dialog.py +++ b/portprotonqt/dialogs/settings_dialog.py @@ -583,6 +583,12 @@ class ExeSettingsDialog(DraggableDialog, MangoHudSettingsMixin, GamescopeSetting if setting['type'] == 'combo': combo = QComboBox() + combo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + combo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) combo.addItems(setting['options']) if setting['key'] == 'PW_PREFIX_NAME': combo.setEditable(True) diff --git a/portprotonqt/dialogs/settings_gamescope.py b/portprotonqt/dialogs/settings_gamescope.py index af624981..1e2a26bf 100644 --- a/portprotonqt/dialogs/settings_gamescope.py +++ b/portprotonqt/dialogs/settings_gamescope.py @@ -412,6 +412,12 @@ class GamescopeSettingsMixin: def _create_gamescope_resolution_widget(self, target): """Create a resolution combo widget and bind it to width/height fields.""" widget = QComboBox() + widget.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + widget.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) widget.addItem(_("Default value"), '') for resolution in self._get_gamescope_resolution_options(): widget.addItem(resolution, resolution) @@ -523,6 +529,12 @@ class GamescopeSettingsMixin: def _create_gamescope_value_widget(self, spec): """Create a Gamescope value widget.""" widget = QComboBox() + widget.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + widget.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) options = spec['options'] placeholder_text = _("Default value") for option in options: @@ -589,6 +601,12 @@ class GamescopeSettingsMixin: self.gamescope_toggle_group = selector_group self.gamescope_category_combo = QComboBox() + self.gamescope_category_combo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.gamescope_category_combo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.gamescope_category_combo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) selector_layout.addWidget(self.gamescope_category_combo) diff --git a/portprotonqt/dialogs/settings_mangohud.py b/portprotonqt/dialogs/settings_mangohud.py index dad98f3b..32c97cfc 100644 --- a/portprotonqt/dialogs/settings_mangohud.py +++ b/portprotonqt/dialogs/settings_mangohud.py @@ -443,6 +443,12 @@ class MangoHudSettingsMixin: def _create_mangohud_value_widget(self, spec): """Create a MangoHud value widget.""" widget = QComboBox() + widget.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + widget.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) options = spec['options'] placeholder_text = _("Default value") if spec['key'] == 'network': @@ -549,6 +555,12 @@ class MangoHudSettingsMixin: self.mangohud_toggle_group = selector_group self.mangohud_category_combo = QComboBox() + self.mangohud_category_combo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.mangohud_category_combo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.mangohud_category_combo.addItems(list(MANGOHUD_TOGGLE_CATEGORIES.keys())) self.mangohud_category_combo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) self.mangohud_category_combo.currentTextChanged.connect(self.on_mangohud_category_changed) diff --git a/portprotonqt/main_window.py b/portprotonqt/main_window.py index eef86233..e9d268d1 100644 --- a/portprotonqt/main_window.py +++ b/portprotonqt/main_window.py @@ -1696,6 +1696,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind self.wine_versions.append(version) self.wine_versions.sort(key=version_sort_key) self.wineCombo = QComboBox() + self.wineCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.wineCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.wineCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.wineCombo.addItems(self.wine_versions) self.wineCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) @@ -1709,6 +1715,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind self.prefixes = sorted([d for d in os.listdir(prefixes_path) if os.path.isdir(os.path.join(prefixes_path, d))], key=prefix_sort_key) if os.path.exists(prefixes_path) else [] self.prefixCombo = QComboBox() + self.prefixCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.prefixCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.prefixCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.prefixCombo.addItems(self.prefixes) self.prefixCombo.setEditable(True) @@ -2164,6 +2176,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind scrollLayout.addWidget(genFrame) self.timeDetailCombo = QComboBox() + self.timeDetailCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.timeDetailCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.timeDetailCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.time_keys = ["detailed", "brief"] self.time_labels = [_("Detailed"), _("Brief")] @@ -2183,6 +2201,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind genForm.addRow(self.timeDetailTitle, self.timeDetailCombo) self.gamesSortCombo = QComboBox() + self.gamesSortCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.gamesSortCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.gamesSortCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.sort_keys = ["last_launch", "playtime", "alphabetical"] self.sort_labels = [_("Last launch"), _("Playtime"), _("Alphabetical")] @@ -2204,6 +2228,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind self.filter_keys = ["all", "steam", "portproton", "favorites"] self.filter_labels = [_("All"), "Steam", "PortProton", _("Favorites")] self.gamesDisplayCombo = QComboBox() + self.gamesDisplayCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.gamesDisplayCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.gamesDisplayCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.gamesDisplayCombo.addItems(self.filter_labels) self.gamesDisplayCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) @@ -2223,6 +2253,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind self.badge_view_keys = ["detailed", "compact", "hidden"] self.badge_view_labels = [_("Detailed"), _("Compact"), _("Hidden")] self.badgeViewCombo = QComboBox() + self.badgeViewCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.badgeViewCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.badgeViewCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.badgeViewCombo.addItems(self.badge_view_labels) self.badgeViewCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) @@ -2428,6 +2464,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind filtered_gpu_list = get_selectable_gpu_list() if filtered_gpu_list: self.gpuCombo = QComboBox() + self.gpuCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.gpuCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.gpuCombo.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.gpuCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus) self.gpuCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) @@ -2753,6 +2795,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind self.themeTabHeaderLayout.addWidget(self.themeTabTitleLabel) self.themesCombo = QComboBox() + self.themesCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.themesCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.themesCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) self.themesCombo.setObjectName("themeTabCombo") self.themesCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus) @@ -2770,6 +2818,12 @@ class MainWindow(MainWindowControlHintsMixin, MainWindowSystemTabMixin, MainWind self.themeTabHeaderLayout.addWidget(self.themesCombo) self.themeVariantCombo = QComboBox() + self.themeVariantCombo.view().window().setWindowFlags( + Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint + ) + self.themeVariantCombo.view().window().setAttribute( + Qt.WidgetAttribute.WA_TranslucentBackground + ) self.themeVariantCombo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE) self.themeVariantCombo.setObjectName("themeVariantCombo") self.themeVariantCombo.setFocusPolicy(Qt.FocusPolicy.StrongFocus) diff --git a/portprotonqt/tabs/system_tab.py b/portprotonqt/tabs/system_tab.py index 691ec970..51ab4876 100644 --- a/portprotonqt/tabs/system_tab.py +++ b/portprotonqt/tabs/system_tab.py @@ -718,6 +718,8 @@ class MainWindowSystemTabMixin(_MainWindowTypingBase): def _createSystemContextMenu(self) -> QMenu: menu = QMenu(self) + menu.setWindowFlags(menu.windowFlags() | Qt.WindowType.Popup | Qt.WindowType.FramelessWindowHint) + menu.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) menu.setStyleSheet(self.theme.CONTEXT_MENU_STYLE) menu.setParent(self, Qt.WindowType.Popup) return menu diff --git a/portprotonqt/themes/standart-light/styles.py b/portprotonqt/themes/standart-light/styles.py index e6efdb6f..4905fff7 100644 --- a/portprotonqt/themes/standart-light/styles.py +++ b/portprotonqt/themes/standart-light/styles.py @@ -1401,6 +1401,8 @@ CONTEXT_MENU_STYLE = f""" font-size: {font_size_a}; padding: 5px; min-width: 150px; + border: {border_b} {color_a}; + border-radius: {border_radius_a}; }} QMenu::icon {{ margin-left: 15px; diff --git a/portprotonqt/themes/standart/styles/theme_utils.py b/portprotonqt/themes/standart/styles/theme_utils.py index 28798bfa..f1913ce4 100644 --- a/portprotonqt/themes/standart/styles/theme_utils.py +++ b/portprotonqt/themes/standart/styles/theme_utils.py @@ -8,6 +8,8 @@ CONTEXT_MENU_STYLE = f""" font-size: {font_size_a}; padding: 5px; min-width: 150px; + border: {border_b} {color_a}; + border-radius: {border_radius_a}; }} QMenu::icon {{ margin-left: 15px;