Add setting to set style

This commit is contained in:
Jonas Kvinge
2020-11-08 02:04:24 +01:00
parent c9c3fb396a
commit 0ae7c18f1f
4 changed files with 87 additions and 21 deletions

View File

@@ -97,6 +97,7 @@
# include "core/translations.h"
#endif
#include "settings/behavioursettingspage.h"
#include "settings/appearancesettingspage.h"
#ifdef HAVE_DBUS
# include "osd/osddbus.h"
@@ -197,6 +198,16 @@ int main(int argc, char* argv[]) {
// Gnome on Ubuntu has menu icons disabled by default. I think that's a bad idea, and makes some menus in Strawberry look confusing.
QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus, false);
{
QSettings s;
s.beginGroup(AppearanceSettingsPage::kSettingsGroup);
QString style = s.value(AppearanceSettingsPage::kStyle, "default").toString();
s.endGroup();
if (style != "default") {
QApplication::setStyle(style);
}
}
// Set the permissions on the config file on Unix - it can contain passwords for internet services so it's important that other users can't read it.
// On Windows these are stored in the registry instead.
#ifdef Q_OS_UNIX