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.
This commit is contained in:
@@ -368,6 +368,10 @@ MainMenu::MainMenu(MainWindow *parent)
|
|||||||
|
|
||||||
tools_preferences_item_ = tools_menu_->AddItem(
|
tools_preferences_item_ = tools_menu_->AddItem(
|
||||||
"prefs", Core::instance(), &Core::DialogPreferencesShow, tr("Ctrl+,"));
|
"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
|
#ifndef NDEBUG
|
||||||
tools_magic_item_ =
|
tools_magic_item_ =
|
||||||
|
|||||||
Reference in New Issue
Block a user