Browse Source

Merge pull request #778 from Susurrus/master

Fix remaining Windows issues on Qt5
QGC4.4
Susurrus 11 years ago
parent
commit
2c78833643
  1. 8
      files/styles/style-dark.css
  2. 8
      files/styles/style-light.css
  3. 2
      src/main.cc
  4. 4
      src/ui/MainWindow.cc

8
files/styles/style-dark.css

@ -334,6 +334,14 @@ QMenu::separator { @@ -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;

8
files/styles/style-light.css

@ -278,6 +278,14 @@ QMenu::separator { @@ -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;

2
src/main.cc

@ -55,7 +55,7 @@ This file is part of the QGROUNDCONTROL project @@ -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();
}

4
src/ui/MainWindow.cc

@ -191,13 +191,11 @@ void MainWindow::init() @@ -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);

Loading…
Cancel
Save