2023-06-24 20:39:55 +08:00
|
|
|
|
// SiYuan - Refactor your thinking
|
2022-05-26 15:18:53 +08:00
|
|
|
|
// Copyright (c) 2020-present, b3log.org
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
|
//
|
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
package conf
|
|
|
|
|
|
|
2025-11-12 22:22:12 +08:00
|
|
|
|
import "github.com/siyuan-note/siyuan/kernel/util"
|
|
|
|
|
|
|
2022-05-26 15:18:53 +08:00
|
|
|
|
type Appearance struct {
|
2024-09-26 11:17:27 +08:00
|
|
|
|
Mode int `json:"mode"` // 模式:0:明亮,1:暗黑
|
|
|
|
|
|
ModeOS bool `json:"modeOS"` // 模式是否跟随系统
|
|
|
|
|
|
DarkThemes []*AppearanceTheme `json:"darkThemes"` // 暗黑模式外观主题列表
|
|
|
|
|
|
LightThemes []*AppearanceTheme `json:"lightThemes"` // 明亮模式外观主题列表
|
|
|
|
|
|
ThemeDark string `json:"themeDark"` // 选择的暗黑模式外观主题
|
|
|
|
|
|
ThemeLight string `json:"themeLight"` // 选择的明亮模式外观主题
|
|
|
|
|
|
ThemeVer string `json:"themeVer"` // 选择的主题版本
|
|
|
|
|
|
Icons []string `json:"icons"` // 图标列表
|
|
|
|
|
|
Icon string `json:"icon"` // 选择的图标
|
|
|
|
|
|
IconVer string `json:"iconVer"` // 选择的图标版本
|
|
|
|
|
|
CodeBlockThemeLight string `json:"codeBlockThemeLight"` // 明亮模式下代码块主题
|
|
|
|
|
|
CodeBlockThemeDark string `json:"codeBlockThemeDark"` // 暗黑模式下代码块主题
|
|
|
|
|
|
Lang string `json:"lang"` // 选择的界面语言,同 AppConf.Lang
|
|
|
|
|
|
ThemeJS bool `json:"themeJS"` // 是否启用了主题 JavaScript
|
|
|
|
|
|
CloseButtonBehavior int `json:"closeButtonBehavior"` // 关闭按钮行为,0:退出,1:最小化到托盘
|
|
|
|
|
|
HideStatusBar bool `json:"hideStatusBar"` // 是否隐藏底部状态栏
|
2025-11-12 22:22:12 +08:00
|
|
|
|
StatusBar *util.StatusBar `json:"statusBar"` // 底部状态栏配置
|
2022-05-26 15:18:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewAppearance() *Appearance {
|
|
|
|
|
|
return &Appearance{
|
|
|
|
|
|
Mode: 0,
|
2022-09-25 22:26:37 +08:00
|
|
|
|
ModeOS: true,
|
2022-05-26 15:18:53 +08:00
|
|
|
|
ThemeDark: "midnight",
|
|
|
|
|
|
ThemeLight: "daylight",
|
|
|
|
|
|
Icon: "material",
|
|
|
|
|
|
CodeBlockThemeLight: "github",
|
|
|
|
|
|
CodeBlockThemeDark: "base16/dracula",
|
|
|
|
|
|
Lang: "en_US",
|
|
|
|
|
|
CloseButtonBehavior: 0,
|
2022-06-26 22:27:18 +08:00
|
|
|
|
HideStatusBar: false,
|
2025-11-12 22:22:12 +08:00
|
|
|
|
StatusBar: &util.StatusBar{},
|
2022-05-26 15:18:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-09-26 11:17:27 +08:00
|
|
|
|
|
|
|
|
|
|
type AppearanceTheme struct {
|
|
|
|
|
|
Name string `json:"name"` // daylight
|
|
|
|
|
|
Label string `json:"label"` // i18n display name
|
|
|
|
|
|
}
|