From fb29ea5b154b4603386697345f18a255145541b2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 9 Mar 2022 23:46:42 +0200 Subject: [PATCH 41/41] Qt: Make "Options" submenu to not disappear on MacOS Reported by ddeanbrown See osdn #43944 Signed-off-by: Marko Lindqvist --- client/gui-qt/menu.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/gui-qt/menu.cpp b/client/gui-qt/menu.cpp index 861a432378..c2bf464463 100644 --- a/client/gui-qt/menu.cpp +++ b/client/gui-qt/menu.cpp @@ -984,7 +984,18 @@ void mr_menu::setup_menus() /* Game Menu */ main_menu = this->addMenu(_("Game")); + +#ifdef __APPLE__ + // On Mac, Qt would try to move menu entry named just "Options" to + // application menu, but as this is submenu and not an action + // 1) It would fail to appear in the destination + // 2) It's impossible to override the behavior with QAction::menuRule() + // We add an invisible character for the string comparison to fail. + sub_menu = main_menu->addMenu(QString("\u200B") + _("Options")); +#else // __APPLE__ sub_menu = main_menu->addMenu(_("Options")); +#endif // __APPLE__ + act = sub_menu->addAction(_("Set local options")); connect(act, &QAction::triggered, this, &mr_menu::local_options); act = sub_menu->addAction(_("Server Options")); -- 2.34.1