Skip to content

Commit

Permalink
Use Breeze style in Flatpak
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin committed Jul 12, 2020
1 parent 5671a95 commit 1aac008
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
#include <QtCore/QCommandLineParser>
#include <QtCore/QDebug>
#include <QtCore/QStandardPaths>
#include <QtWidgets/QStyleFactory>

#include "networksettings.h"
#include "mainwindow.h"
#include "activitydetector.h"
#include "linuxutils.h"
#include <settings.h>

void loadTranslations(
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions client/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)"),
Expand Down

0 comments on commit 1aac008

Please sign in to comment.