From e9283388c84c5dbb7b22db2ebe13797eb0cd200d Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 9 Mar 2022 23:55:02 +0200 Subject: [PATCH 6/6] 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 8ad6be4db7..84bc3bc49e 100644 --- a/client/gui-qt/menu.cpp +++ b/client/gui-qt/menu.cpp @@ -823,7 +823,18 @@ void mr_menu::setup_menus() /* Game Menu */ menu = this->addMenu(_("Game")); pr = menu; + +#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. + menu = menu->addMenu(QString("\u200B") + _("Options")); +#else // __APPLE__ menu = menu->addMenu(_("Options")); +#endif // __APPLE__ + act = menu->addAction(_("Set local options")); connect(act, &QAction::triggered, this, &mr_menu::local_options); act = menu->addAction(_("Server Options")); -- 2.34.1