A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
1// SiYuan - Refactor your thinking
2// Copyright (c) 2020-present, b3log.org
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Affero General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Affero General Public License for more details.
13//
14// You should have received a copy of the GNU Affero General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17package conf
18
19import "github.com/siyuan-note/siyuan/kernel/util"
20
21type Appearance struct {
22 Mode int `json:"mode"` // 模式:0:明亮,1:暗黑
23 ModeOS bool `json:"modeOS"` // 模式是否跟随系统
24 DarkThemes []*AppearanceTheme `json:"darkThemes"` // 暗黑模式外观主题列表
25 LightThemes []*AppearanceTheme `json:"lightThemes"` // 明亮模式外观主题列表
26 ThemeDark string `json:"themeDark"` // 选择的暗黑模式外观主题
27 ThemeLight string `json:"themeLight"` // 选择的明亮模式外观主题
28 ThemeVer string `json:"themeVer"` // 选择的主题版本
29 Icons []string `json:"icons"` // 图标列表
30 Icon string `json:"icon"` // 选择的图标
31 IconVer string `json:"iconVer"` // 选择的图标版本
32 CodeBlockThemeLight string `json:"codeBlockThemeLight"` // 明亮模式下代码块主题
33 CodeBlockThemeDark string `json:"codeBlockThemeDark"` // 暗黑模式下代码块主题
34 Lang string `json:"lang"` // 选择的界面语言,同 AppConf.Lang
35 ThemeJS bool `json:"themeJS"` // 是否启用了主题 JavaScript
36 CloseButtonBehavior int `json:"closeButtonBehavior"` // 关闭按钮行为,0:退出,1:最小化到托盘
37 HideStatusBar bool `json:"hideStatusBar"` // 是否隐藏底部状态栏
38 StatusBar *util.StatusBar `json:"statusBar"` // 底部状态栏配置
39}
40
41func NewAppearance() *Appearance {
42 return &Appearance{
43 Mode: 0,
44 ModeOS: true,
45 ThemeDark: "midnight",
46 ThemeLight: "daylight",
47 Icon: "material",
48 CodeBlockThemeLight: "github",
49 CodeBlockThemeDark: "base16/dracula",
50 Lang: "en_US",
51 CloseButtonBehavior: 0,
52 HideStatusBar: false,
53 StatusBar: &util.StatusBar{},
54 }
55}
56
57type AppearanceTheme struct {
58 Name string `json:"name"` // daylight
59 Label string `json:"label"` // i18n display name
60}