diff --git a/qt-gui.cpp b/qt-gui.cpp index 31b6c1b0b..bab27a318 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include const char *default_dive_computer_vendor; const char *default_dive_computer_product; @@ -84,17 +86,14 @@ const char *getSetting(QSettings &s, QString name) void init_ui(int *argcp, char ***argvp) { QVariant v; -#ifdef __linux__ - // for people running under Gnome the default style is - // really ugly; this seems like a bad hack, but it makes - // things look somewhat better - // I'd much rather be able to check if it is using the Gnome - // style and only then force plastique but I haven't been - // able to figure out how to do that - QApplication::setStyle("plastique"); -#endif + application = new QApplication(*argcp, *argvp); + // the Gtk theme makes things unbearably ugly + // so switch to Oxygen in this case + if (application->style()->objectName() == "gtk+") + application->setStyle("Oxygen"); + #if QT_VERSION < 0x050000 // ask QString in Qt 4 to interpret all char* as UTF-8, // like Qt 5 does.