Add PCN theme system

Coexist with the old theme system for now. QML components have to be
updated to use the new system.
This commit is contained in:
miruka
2020-11-17 08:24:55 -04:00
parent 1af1d30c48
commit 42f04b013e
15 changed files with 159 additions and 16 deletions

View File

@@ -73,6 +73,7 @@ QtObject {
}
type === "Settings" ? window.settings = newData :
type === "NewTheme" ? window.themeRules = newData :
type === "UIState" ? window.uiState = newData :
type === "History" ? window.history = newData :
null

View File

@@ -21,12 +21,13 @@ PythonBridge {
addImportPath("qrc:/src")
importNames("backend.qml_bridge", ["BRIDGE"], () => {
callCoro("get_settings", [], ([settings, state, hist, theme]) => {
window.settings = settings
window.uiState = state
window.history = hist
window.theme = Qt.createQmlObject(theme, window, "theme")
utils.theme = window.theme
callCoro("get_settings", [], ([settings, state, hist, theme, themeRules]) => {
window.settings = settings
window.uiState = state
window.history = hist
window.theme = Qt.createQmlObject(theme, window, "theme")
utils.theme = window.theme
window.themeRules = themeRules
callCoro("saved_accounts.any_saved", [], any => {
if (any) { callCoro("load_saved_accounts", []) }