Merge pull request #827 from kthchew/fix/menubar-separator

Workaround Qt bug to fix menu bar separators on macOS
This commit is contained in:
Ezekiel Smith 2022-06-27 01:14:15 +10:00 committed by GitHub
commit 774ed044fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -503,6 +503,8 @@ public:
menuBar->setVisible(APPLICATION->settings()->get("MenuBarInsteadOfToolBar").toBool()); menuBar->setVisible(APPLICATION->settings()->get("MenuBarInsteadOfToolBar").toBool());
fileMenu = menuBar->addMenu(tr("&File")); fileMenu = menuBar->addMenu(tr("&File"));
// Workaround for QTBUG-94802 (https://bugreports.qt.io/browse/QTBUG-94802); also present for other menus
fileMenu->setSeparatorsCollapsible(false);
fileMenu->addAction(actionAddInstance); fileMenu->addAction(actionAddInstance);
fileMenu->addAction(actionLaunchInstance); fileMenu->addAction(actionLaunchInstance);
fileMenu->addAction(actionLaunchInstanceOffline); fileMenu->addAction(actionLaunchInstanceOffline);
@ -526,15 +528,18 @@ public:
fileMenu->addAction(actionSettings); fileMenu->addAction(actionSettings);
viewMenu = menuBar->addMenu(tr("&View")); viewMenu = menuBar->addMenu(tr("&View"));
viewMenu->setSeparatorsCollapsible(false);
viewMenu->addAction(actionCAT); viewMenu->addAction(actionCAT);
viewMenu->addSeparator(); viewMenu->addSeparator();
menuBar->addMenu(foldersMenu); menuBar->addMenu(foldersMenu);
profileMenu = menuBar->addMenu(tr("&Profiles")); profileMenu = menuBar->addMenu(tr("&Profiles"));
profileMenu->setSeparatorsCollapsible(false);
profileMenu->addAction(actionManageAccounts); profileMenu->addAction(actionManageAccounts);
helpMenu = menuBar->addMenu(tr("&Help")); helpMenu = menuBar->addMenu(tr("&Help"));
helpMenu->setSeparatorsCollapsible(false);
helpMenu->addAction(actionAbout); helpMenu->addAction(actionAbout);
helpMenu->addAction(actionOpenWiki); helpMenu->addAction(actionOpenWiki);
helpMenu->addAction(actionNewsMenuBar); helpMenu->addAction(actionNewsMenuBar);