diff --git a/client/main.cpp b/client/main.cpp index 669609c2f..ed58af4e9 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -23,10 +23,12 @@ #include #include #include +#include #include "networksettings.h" #include "mainwindow.h" #include "activitydetector.h" +#include "linuxutils.h" #include void loadTranslations( @@ -93,6 +95,22 @@ int main( int argc, char* argv[] ) QApplication::setFont(font); } +#if defined Q_OS_UNIX && !defined Q_OS_MAC + const auto useBreezeStyle = Quotient::Settings().get("UI/use_breeze_style", inFlatpak()); + + // Set style to Breeze since Qt applications defaults to + // a very ugly Fusion style in Flatpak outside KDE + if (useBreezeStyle) + { + // Set icon theme as well to have uniform design + QApplication::setStyle("Breeze"); + QIcon::setThemeName("breeze"); +#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) + QIcon::setFallbackThemeName("breeze"); +#endif + } +#endif + // We should not need to do the following, as quitOnLastWindowClosed is // set to "true" by default; might be a bug, see // https://forum.qt.io/topic/71112/application-does-not-quit diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 04819179e..741b3c3d0 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -436,6 +436,14 @@ void MainWindow::createMenu() else defaultLayout->setChecked(true); } +#if defined Q_OS_UNIX && !defined Q_OS_MAC + addTimelineOptionCheckbox( + settingsMenu, + tr("Use Breeze style (requires restart)"), + tr("Force use Breeze style and icon theme"), + QStringLiteral("use_breeze_style"), inFlatpak() + ); +#endif addTimelineOptionCheckbox( settingsMenu, tr("Use shuttle scrollbar (requires restart)"),