This commit is contained in:
Daniel 2024-10-31 09:54:40 +08:00
parent 99fc85875c
commit 3d81af698c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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() {