From bda83d43b19d8694b375c58c148d35eae697bf3c Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Thu, 18 Jul 2024 18:15:54 +0200 Subject: [PATCH] Add menu roles for better mac menus Adding "menuRole" properties to standard menu actions (About, Preferences, Quit) lets Qt move them to their standard place in the macOS menu bar (without having to rely on their text content, which breaks when localizing). This also automatically sets the "Preferences" shortcut to the standard "Cmd+," instead of "Cmd+P". This should have no impact on other platforms. See https://doc.qt.io/qt-6/qmenubar.html#qmenubar-as-a-global-menu-bar --- src/main/python/main/ayab/menu_gui.ui | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/python/main/ayab/menu_gui.ui b/src/main/python/main/ayab/menu_gui.ui index 8f09e8ef..10e25cfc 100644 --- a/src/main/python/main/ayab/menu_gui.ui +++ b/src/main/python/main/ayab/menu_gui.ui @@ -65,6 +65,9 @@ Ctrl+Q + + QAction::QuitRole + @@ -96,6 +99,9 @@ Help – About + + QAction::AboutRole + @@ -189,6 +195,9 @@ Ctrl+P + + QAction::PreferencesRole +