feat: add system theme on Qt 6.5 and up (#5118)

* feat: add system theme on Qt 6.5

* chroe: add changelog entry

* refactor: add separate settings

* fix: qt 5

* Update changelog entry

---------

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2024-01-27 11:53:19 +01:00
committed by GitHub
parent 7d7f1b3bea
commit c32ee8e5b5
5 changed files with 105 additions and 11 deletions
+6
View File
@@ -46,6 +46,7 @@ public:
void initialize(Settings &settings, const Paths &paths) final;
bool isLightTheme() const;
bool isSystemTheme() const;
struct TabColors {
QColor text;
@@ -153,6 +154,9 @@ public:
pajlada::Signals::NoArgSignal updated;
QStringSetting themeName{"/appearance/theme/name", "Dark"};
QStringSetting lightSystemThemeName{"/appearance/theme/lightSystem",
"Light"};
QStringSetting darkSystemThemeName{"/appearance/theme/darkSystem", "Dark"};
private:
bool isLight_ = false;
@@ -164,6 +168,8 @@ private:
// This will only be populated when auto-reloading themes
QJsonObject currentThemeJson_;
QObject lifetime_;
/**
* Figure out which themes are available in the Themes directory
*