From 15525528c911342cef12394f16afb575e9728715 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Thu, 16 Jul 2026 22:31:21 +0800 Subject: [PATCH] mainwindow: keep Preferences in the Tools menu on macOS On macOS Qt's text-heuristic menu role relocates any action whose text starts with "Preferences" into the application menu. With the English translation the Tools > Preferences action matched the heuristic and disappeared from the Tools menu. Pin the action to QAction::NoRole so it stays in the Tools menu on every platform and language. --- app/window/mainwindow/mainmenu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/window/mainwindow/mainmenu.cpp b/app/window/mainwindow/mainmenu.cpp index a090d11da..90f257b57 100644 --- a/app/window/mainwindow/mainmenu.cpp +++ b/app/window/mainwindow/mainmenu.cpp @@ -368,6 +368,10 @@ MainMenu::MainMenu(MainWindow *parent) tools_preferences_item_ = tools_menu_->AddItem( "prefs", Core::instance(), &Core::DialogPreferencesShow, tr("Ctrl+,")); + // On macOS, Qt's text heuristic would relocate an English "Preferences" + // action to the application menu, making it disappear from the Tools menu. + // Pin it to this menu on all platforms. + tools_preferences_item_->setMenuRole(QAction::NoRole); #ifndef NDEBUG tools_magic_item_ =