2020-11-25 14:41:29 +01:00

24 lines
609 B
QML

pragma Singleton
import QtQuick 2.13
import "./Themes"
QtObject {
property Theme current: lightTheme
property Theme lightTheme: LightTheme {}
property Theme darkTheme: DarkTheme {}
property var changeTheme: function (theme) {
switch (theme) {
case "light": current = lightTheme; break;
case "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)
}
}