2020-07-02 15:14:31 +00:00
|
|
|
pragma Singleton
|
|
|
|
|
|
|
|
import QtQuick 2.13
|
2021-04-16 10:37:53 +00:00
|
|
|
import QtQuick.Controls.Universal 2.12
|
2021-06-11 12:12:51 +00:00
|
|
|
import "./Themes" as Legacy
|
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2020-07-02 15:14:31 +00:00
|
|
|
|
|
|
|
QtObject {
|
2021-06-11 12:12:51 +00:00
|
|
|
property Legacy.Theme current: lightTheme
|
|
|
|
property Legacy.Theme lightTheme: Legacy.LightTheme {}
|
|
|
|
property Legacy.Theme darkTheme: Legacy.DarkTheme {}
|
|
|
|
|
|
|
|
|
|
|
|
property ThemePalette statusQLightTheme: StatusLightTheme {}
|
|
|
|
property ThemePalette statusQDarkTheme: StatusDarkTheme {}
|
|
|
|
|
2020-07-01 17:35:57 +00:00
|
|
|
|
|
|
|
property var changeTheme: function (theme) {
|
|
|
|
switch (theme) {
|
2021-06-11 12:12:51 +00:00
|
|
|
case Universal.Light:
|
|
|
|
current = lightTheme;
|
|
|
|
Theme.palette = statusQLightTheme
|
|
|
|
break;
|
|
|
|
case Universal.Dark:
|
|
|
|
current = darkTheme;
|
|
|
|
Theme.palette = statusQDarkTheme
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
current = lightTheme;
|
|
|
|
Theme.palette = statusQLightTheme
|
|
|
|
console.log('Unknown theme. Valid themes are "light" and "dark"')
|
2020-07-01 17:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
2020-11-25 10:46:18 +00:00
|
|
|
|
|
|
|
property var changeFontSize: function (fontSize) {
|
|
|
|
current.updateFontSize(fontSize)
|
|
|
|
}
|
2020-07-02 15:14:31 +00:00
|
|
|
}
|