refactor(tray): replace QMenu with native Win32 popup menu#887
Merged
Conversation
…zeWMConfig - This change allows for more flexible configuration by requiring explicit command definitions.
- Replaced PyQt6 QMenu context menu with native win32gui popup menu - Added dark mode support via undocumented uxtheme.dll ordinals - Removed eventFilter and _load_context_menu in favour of _show_context_menu - WM commands now default to None, WM submenus are config-driven - Fixed _chek_startup typo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced the QMenu-based tray menu with a native Win32 popup menu.
The old menu was a styled QMenu which had some issues, it required an event filter to close on outside clicks, and the styling was hardcoded CSS that didn't always feel native. This switches to
win32gui.TrackPopupMenuwhich gives us a proper Windows context menu that behaves exactly like any other system tray menu.Also cleaned up the Komorebi/GlazeWM config handling. Previously the commands had hardcoded defaults so they'd always show up in the tray even if you weren't using those WMs. Now they default to
Noneand the submenu only appears if you've actually set commands in your config AND the binary is on your PATH. Individual items (Start/Stop/Reload) are also skipped if their command isn't set.Small fixes:
_chek_startuptypo to_check_startupeventFilterand_load_context_menuwhich are no longer needed