Use 'system' theme as default if QT_QPA_PLATFORMTHEME is set

On first launch, before the user has configured any settings,
check the value of the QT_QPA_PLATFORMTHEME environment var.
If it is set, use the system theme as the default instead of the
light theme.  This fixes #72.
This commit is contained in:
Joseph Donofry 2019-08-10 13:14:37 -04:00
parent 7c7889a04d
commit d5bb0936bf
No known key found for this signature in database
GPG key ID: E8A1D78EF044B0CB
3 changed files with 21 additions and 7 deletions

View file

@ -22,9 +22,11 @@
#include <QLabel>
#include <QLineEdit>
#include <QMessageBox>
#include <QProcessEnvironment>
#include <QPushButton>
#include <QScrollArea>
#include <QSettings>
#include <QString>
#include <QTextStream>
#include "Config.h"
@ -49,7 +51,7 @@ UserSettings::load()
isGroupViewEnabled_ = settings.value("user/group_view", true).toBool();
isTypingNotificationsEnabled_ = settings.value("user/typing_notifications", true).toBool();
isReadReceiptsEnabled_ = settings.value("user/read_receipts", true).toBool();
theme_ = settings.value("user/theme", "light").toString();
theme_ = settings.value("user/theme", defaultTheme_).toString();
font_ = settings.value("user/font_family", "default").toString();
emojiFont_ = settings.value("user/emoji_font_family", "default").toString();
baseFontSize_ = settings.value("user/font_size", QFont().pointSizeF()).toDouble();