diff --git a/files/styles/style-dark.css b/files/styles/style-dark.css index 5f6c8da60dce8d26a8a6d9125500e30abd9f751e..9716a8594e5ad03668c554b8c9e5d56b09b5127a 100644 --- a/files/styles/style-dark.css +++ b/files/styles/style-dark.css @@ -334,6 +334,14 @@ QMenu::separator { margin: 8px 5px 4px 5px; } +/* + * Fix for bug in Qt5 where QMenuBar items are styled natively on Windows, ignoring inherited settings. + * so we explicitly set their background color here (should match catch-all style background color). + */ +QMenuBar::item { + background-color: #222; +} + QMenuBar::item:selected { background-color: #CCC; color: #000; diff --git a/files/styles/style-light.css b/files/styles/style-light.css index 25c38addf4d8854ad865f695abcf67fb55f95174..74ab01cb9dccc5e76aacfe9d3be2898ec162c00f 100644 --- a/files/styles/style-light.css +++ b/files/styles/style-light.css @@ -278,6 +278,14 @@ QMenu::separator { margin: 8px 5px 4px 5px; } +/* + * Fix for bug in Qt5 where QMenuBar items are styled natively on Windows, ignoring inherited settings. + * so we explicitly set their background color here (should match catch-all style background color). + */ +QMenuBar::item { + background-color: #F6F6F6; +} + QMenuBar::item:selected { background-color: #555; color: #FFF; diff --git a/src/main.cc b/src/main.cc index ab7d0c985111142f915097bd2ac6377bdac29050..b945d8530446708700bd92ef1555cbbe3e41c5f2 100644 --- a/src/main.cc +++ b/src/main.cc @@ -55,7 +55,7 @@ This file is part of the QGROUNDCONTROL project void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { const char symbols[] = { 'I', 'E', '!', 'X' }; - QString output = QString("[%1] in %2:%3 - \"%2\"").arg(symbols[type]).arg(context.file).arg(context.line).arg(msg); + QString output = QString("[%1] at %2:%3 - \"%4\"").arg(symbols[type]).arg(context.file).arg(context.line).arg(msg); std::cerr << output.toStdString() << std::endl; if( type == QtFatalMsg ) abort(); } diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index cc78d0f9624d84c546202c8a51f12bd6066a177e..9598756a2bb7533513da61b99dff161330a0a7cf 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -191,13 +191,11 @@ void MainWindow::init() 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 - // We only need this menu if we have more than one system - // ui.menuConnected_Systems->setEnabled(false); - // Set dock options setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks);