From e1eb9f42ff5aec6190245b68f63feb91ba0410aa Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 5 Aug 2014 21:03:32 +0200 Subject: [PATCH] Fix native menu bar on Mac OS --- src/ui/MainWindow.cc | 13 ++++++------- src/ui/main/QGCWelcomeMainWindow.cc | 1 - src/ui/main/QGCWelcomeMainWindow.ui | 8 ++------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index d42bfcc9a..0636532dd 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -186,15 +186,8 @@ void MainWindow::init() // Setup user interface ui.setupUi(this); - hide(); menuActionHelper->setMenu(ui.menuTools); - // Qt 4 on Ubuntu does place the native menubar correctly so on Linux we revert back to in-window menu bar. - // TODO: Check that this is still necessary on Qt5 on Ubuntu -#ifdef Q_OS_LINUX - menuBar()->setNativeMenuBar(false); -#endif - // Set dock options setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks); @@ -203,6 +196,12 @@ void MainWindow::init() // Setup corners setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); + // Qt 4 on Ubuntu does place the native menubar correctly so on Linux we revert back to in-window menu bar. + // TODO: Check that this is still necessary on Qt5 on Ubuntu +#ifdef Q_OS_LINUX + menuBar()->setNativeMenuBar(false); +#endif + // Setup UI state machines centerStackActionGroup->setExclusive(true); diff --git a/src/ui/main/QGCWelcomeMainWindow.cc b/src/ui/main/QGCWelcomeMainWindow.cc index 721f4995c..862ce88af 100644 --- a/src/ui/main/QGCWelcomeMainWindow.cc +++ b/src/ui/main/QGCWelcomeMainWindow.cc @@ -9,7 +9,6 @@ QGCWelcomeMainWindow::QGCWelcomeMainWindow(QWidget *parent) : storeSettings(false) { ui->setupUi(this); - statusBar()->hide(); QString windowname = qApp->applicationName() + " " + qApp->applicationVersion(); setWindowTitle(windowname); diff --git a/src/ui/main/QGCWelcomeMainWindow.ui b/src/ui/main/QGCWelcomeMainWindow.ui index 5ef45995f..e4b0441e8 100644 --- a/src/ui/main/QGCWelcomeMainWindow.ui +++ b/src/ui/main/QGCWelcomeMainWindow.ui @@ -1,7 +1,5 @@ + - - - QGCWelcomeMainWindow @@ -15,10 +13,8 @@ MainWindow - - - + -- 2.22.0