mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-23 12:59:44 +00:00
c804bb243a
As discussed in https://github.com/status-im/status-desktop/issues/2144#issuecomment-817791172 and https://github.com/status-im/status-desktop/discussions/2145, it's no longer desired to have different appearance settings across multiple accounts. Instead, the appearance setting should apply globally to all accounts, essentially bypassing the individual setting stored in status-go. This commit introduces a new global setting called `theme` which, at the time of introducing this commit, can be either: 0 => Light 1 => Dark 2 => System Because those enum values matches the `AppearanceContainer.Theme` enum, this commit removes it completely and simply relies on QML's built-in `Universal.[Light|Dark|System] variants respectively. Closes #2144
24 lines
663 B
QML
24 lines
663 B
QML
pragma Singleton
|
|
|
|
import QtQuick 2.13
|
|
import QtQuick.Controls.Universal 2.12
|
|
import "./Themes"
|
|
|
|
QtObject {
|
|
property Theme current: lightTheme
|
|
property Theme lightTheme: LightTheme {}
|
|
property Theme darkTheme: DarkTheme {}
|
|
|
|
property var changeTheme: function (theme) {
|
|
switch (theme) {
|
|
case Universal.Light: current = lightTheme; break;
|
|
case Universal.Dark: current = darkTheme; break;
|
|
default: current = lightTheme; console.log('Unknown theme. Valid themes are "light" and "dark"')
|
|
}
|
|
}
|
|
|
|
property var changeFontSize: function (fontSize) {
|
|
current.updateFontSize(fontSize)
|
|
}
|
|
}
|