From f258ca1a3ebc84ebfa6efd2e797a6ea81bd0e22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 17 Nov 2023 13:41:01 +0100 Subject: [PATCH] Prevent broken Qt heuristics to put submenus on wrong places on Mac --- src/GUI/gui.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 4149760d..ee45bf63 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -631,6 +631,7 @@ void GUI::createMenus() _recentFilesMenu = fileMenu->addMenu(tr("Open recent")); _recentFilesMenu->setIcon(QIcon::fromTheme(OPEN_RECENT_NAME, QIcon(OPEN_RECENT_ICON))); + _recentFilesMenu->menuAction()->setMenuRole(QAction::NoRole); _recentFilesMenu->setEnabled(false); _recentFilesEnd = _recentFilesMenu->addSeparator(); _recentFilesMenu->addAction(_clearRecentFilesAction); @@ -680,6 +681,7 @@ void GUI::createMenus() dataMenu->addAction(_showRouteWaypointsAction); dataMenu->addAction(_showTicksAction); QMenu *markerMenu = dataMenu->addMenu(tr("Position info")); + markerMenu->menuAction()->setMenuRole(QAction::NoRole); markerMenu->addAction(_hideMarkersAction); markerMenu->addAction(_showMarkersAction); markerMenu->addAction(_showMarkerDateAction); @@ -717,13 +719,16 @@ void GUI::createMenus() QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings")); QMenu *timeMenu = settingsMenu->addMenu(tr("Time")); + timeMenu->menuAction()->setMenuRole(QAction::NoRole); timeMenu->addAction(_totalTimeAction); timeMenu->addAction(_movingTimeAction); QMenu *unitsMenu = settingsMenu->addMenu(tr("Units")); + unitsMenu->menuAction()->setMenuRole(QAction::NoRole); unitsMenu->addAction(_metricUnitsAction); unitsMenu->addAction(_imperialUnitsAction); unitsMenu->addAction(_nauticalUnitsAction); QMenu *coordinatesMenu = settingsMenu->addMenu(tr("Coordinates format")); + coordinatesMenu->menuAction()->setMenuRole(QAction::NoRole); coordinatesMenu->addAction(_decimalDegreesAction); coordinatesMenu->addAction(_degreesMinutesAction); coordinatesMenu->addAction(_dmsAction);