Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve themes config https://github.com/siyuan-note/siyuan/issues/12976

Daniel3d81af698c1c
diff --git a/kernel/model/appearance.go b/kernel/model/appearance.go
index dccdb8c288..cd08f02483 100644
--- a/kernel/model/appearance.go
+++ b/kernel/model/appearance.go
@@ -116,6 +116,7 @@ func loadThemes() {
Conf.Appearance.DarkThemes = nil
Conf.Appearance.LightThemes = nil
+ var daylightTheme, midnightTheme *conf.AppearanceTheme
for _, themeDir := range themeDirs {
if !util.IsDirRegularOrSymlink(themeDir) {
continue
@@ -151,6 +152,14 @@ func loadThemes() {
}
}
+ if "midnight" == name {
+ midnightTheme = t
+ continue
+ } else if "daylight" == name {
+ daylightTheme = t
+ continue
+ }
+
if "dark" == mode {
Conf.Appearance.DarkThemes = append(Conf.Appearance.DarkThemes, t)
} else if "light" == mode {
@@ -172,6 +181,9 @@ func loadThemes() {
go watchTheme(filepath.Join(util.ThemesPath, name))
}
+
+ Conf.Appearance.LightThemes = append([]*conf.AppearanceTheme{daylightTheme}, Conf.Appearance.LightThemes...)
+ Conf.Appearance.DarkThemes = append([]*conf.AppearanceTheme{midnightTheme}, Conf.Appearance.DarkThemes...)
}
func loadIcons() {