feat: add keyboard shortcut hints to tray menu items#389
Merged
kdroidFilter merged 5 commits intomasterfrom Apr 14, 2026
Merged
feat: add keyboard shortcut hints to tray menu items#389kdroidFilter merged 5 commits intomasterfrom
kdroidFilter merged 5 commits intomasterfrom
Conversation
Add display-only keyboard shortcut hints on macOS via NSMenuItem key equivalents. Windows and Linux accept the parameter as noop. - New KeyShortcut data class with Key enum and modifier flags - TrayMenuBuilder.Item/CheckableItem gain shortcut parameter - macOS: extends tray_menu_item struct with key_equivalent fields, sets keyEquivalent and keyEquivalentModifierMask on NSMenuItem - Demo: add shortcut hints to DynamicIconsDemo menu items
Add native support for displaying keyboard shortcuts in Linux tray menus via the DBusMenu `shortcut` property (aas type). Shortcuts serialize as DBusMenu-compliant modifier+key arrays and render natively on KDE Plasma. GNOME's AppIndicator extension does not render this property visually. - Extend menu_item struct with shortcut fields (key + modifier flags) - Serialize shortcut property in GetLayout and GetGroupProperties responses - Add sni_tray_item_set_shortcut() C API and JNI bridge - Wire shortcuts from Kotlin builder through manager to native code - Add linuxKeyName to Key enum (XKB naming convention) Verified on D-Bus: shortcuts correctly exposed as aas arrays.
9795322 to
6c921dc
Compare
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.
Summary
NSMenuItem.keyEquivalent/keyEquivalentModifierMaskshortcutparameter is accepted but currently a no-opKeyShortcutdata class withKeyenum covering letters, numbers, function keys, and special keysTrayMenuBuilder.Item()andCheckableItem()gain an optionalshortcut: KeyShortcut?parameterAPI usage
Test plan