Add DarkTheme and LightTheme switching
This commit is contained in:
17 files changed
+206
-73
No files matched your search
+16
-2
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Asteria
|
||||
import QtQml
|
||||
|
||||
ApplicationWindow {
|
||||
id: window
|
||||
@@ -8,7 +9,7 @@ ApplicationWindow {
|
||||
height: 768
|
||||
visible: true
|
||||
title: "Asteria"
|
||||
color: Theme.backgroundDeepest
|
||||
color: ThemeManager.currentTheme.backgroundDeepest
|
||||
|
||||
FontLoader {
|
||||
id: materialIcons
|
||||
@@ -30,6 +31,12 @@ ApplicationWindow {
|
||||
x = appState.windowX
|
||||
y = appState.windowY
|
||||
}
|
||||
|
||||
// Initialize theme from AppState
|
||||
if (appState.themeName !== "") {
|
||||
ThemeManager.currentThemeName = appState.themeName
|
||||
}
|
||||
|
||||
if (appState.lastFilePath !== "") {
|
||||
window._restoringState = true
|
||||
bookController.openBook(appState.lastFileUrl())
|
||||
@@ -40,6 +47,13 @@ ApplicationWindow {
|
||||
window.currentPage = savedPage
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: appState
|
||||
function onThemeNameChanged() {
|
||||
ThemeManager.currentThemeName = appState.themeName
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: geometrySaveTimer
|
||||
@@ -93,7 +107,7 @@ ApplicationWindow {
|
||||
Item {
|
||||
id: contentArea
|
||||
width: parent.width
|
||||
height: parent.height - header.height - (footerLoader.active ? Theme.footerHeight : 0)
|
||||
height: parent.height - header.height - (footerLoader.active ? ThemeManager.currentTheme.footerHeight : 0)
|
||||
|
||||
StarterPage {
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in new issue
Block a user