feat: 添加 mica-electron 支持实现窗口毛玻璃效果

- 安装 mica-electron 依赖
- 在 WindowManager 中集成 MicaBrowserWindow 和各种效果方法
- 添加窗口主题、效果、圆角等设置选项
- 扩展 settingsSpec 类型支持新的窗口设置
This commit is contained in:
Linkon
2026-01-20 01:35:07 +08:00
parent 6b41ae079a
commit 95ee5705f6
5 changed files with 265 additions and 6 deletions
+18 -1
View File
@@ -59,7 +59,6 @@ export class SettingsService extends Service {
wc.setZoomFactor(zoom)
})
// 仅更新全局侧边栏窗口的位置(不调整大小,大小由 GlobalSidebar 组件管理)
const sidebarWindow = BrowserWindow.getAllWindows().find((win) => {
try {
return win.webContents.getURL().includes('#global-sidebar')
@@ -81,6 +80,24 @@ export class SettingsService extends Service {
})
}
}
},
window_theme: {
kind: 'string',
defaultValue: 'auto',
writePermission: 'admin',
validate: (v) => v === 'auto' || v === 'dark' || v === 'light'
},
window_effect: {
kind: 'string',
defaultValue: 'mica',
writePermission: 'admin',
validate: (v) => ['mica', 'tabbed', 'acrylic', 'blur', 'transparent', 'none'].includes(v as string)
},
window_radius: {
kind: 'string',
defaultValue: 'rounded',
writePermission: 'admin',
validate: (v) => v === 'rounded' || v === 'small' || v === 'square'
}
}