mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-31 19:17:40 +08:00
feat(界面设计): 默认窗口材质改为纯色
This commit is contained in:
1 parent
841020b881
commit
60f805fab4
3 files changed
+3
-7
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
const preference = matchMedia("(prefers-color-scheme: dark)");
|
const preference = matchMedia("(prefers-color-scheme: dark)");
|
||||||
const key = "ofdgo.theme";
|
const key = "ofdgo.theme";
|
||||||
let mode = root.dataset.themeMode || "system";
|
let mode = root.dataset.themeMode || "system";
|
||||||
let material = root.dataset.windowChoice || "acrylic";
|
let material = root.dataset.windowChoice || "solid";
|
||||||
let host = null, report = null, pending = Promise.resolve(), revision = 0, committed = null;
|
let host = null, report = null, pending = Promise.resolve(), revision = 0, committed = null;
|
||||||
if (!root.dataset.themeMode) {
|
if (!root.dataset.themeMode) {
|
||||||
try { mode = localStorage.getItem(key) || "system"; } catch {}
|
try { mode = localStorage.getItem(key) || "system"; } catch {}
|
||||||
|
|||||||
@@ -1213,16 +1213,12 @@ func windowOptions(dataDir string) (guigo.Options, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return guigo.Options{}, err
|
return guigo.Options{}, err
|
||||||
}
|
}
|
||||||
material := guigo.WindowSolid
|
|
||||||
if guigo.SupportsWindowMaterial(guigo.WindowAcrylic) {
|
|
||||||
material = guigo.WindowAcrylic
|
|
||||||
}
|
|
||||||
return guigo.Options{
|
return guigo.Options{
|
||||||
AppID: appID,
|
AppID: appID,
|
||||||
Title: "OFDGo - OFD编辑器",
|
Title: "OFDGo - OFD编辑器",
|
||||||
TitleBar: guigo.TitleBarContent,
|
TitleBar: guigo.TitleBarContent,
|
||||||
TitleBarColors: themeColors(false),
|
TitleBarColors: themeColors(false),
|
||||||
WindowMaterial: material,
|
WindowMaterial: guigo.WindowSolid,
|
||||||
Icon: icon,
|
Icon: icon,
|
||||||
Width: 1440,
|
Width: 1440,
|
||||||
Height: 900,
|
Height: 900,
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func themeColors(dark bool) guigo.TitleBarColors {
|
|||||||
// loadTheme 在创建窗口前读取用户目录中的主题偏好
|
// loadTheme 在创建窗口前读取用户目录中的主题偏好
|
||||||
// 返回: error 读取或解析错误
|
// 返回: error 读取或解析错误
|
||||||
func (h *Host) loadTheme() error {
|
func (h *Host) loadTheme() error {
|
||||||
h.theme = applicationTheme{Mode: "system", Material: "acrylic"}
|
h.theme = applicationTheme{Mode: "system", Material: "solid"}
|
||||||
data, err := os.ReadFile(h.themePath)
|
data, err := os.ReadFile(h.themePath)
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in new issue
Block a user