Add DarkTheme and LightTheme switching

This commit is contained in:
Agel committed 2026-03-31 20:43:37 +02:00
1 parent 7409ba789a
commit ff88cf581b
17 files changed
+206 -73

No files matched your search

+16 -2
View File
@@ -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