Skip to content

feat: 自定义图片背景#15

Merged
imsyy merged 4 commits intodevfrom
dev-theme
May 7, 2026
Merged

feat: 自定义图片背景#15
imsyy merged 4 commits intodevfrom
dev-theme

Conversation

@imsyy
Copy link
Copy Markdown
Collaborator

@imsyy imsyy commented May 7, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 7, 2026 14:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 为 SPlayer-Next 增加「自定义图片背景」外观风格:允许用户选择本地图片作为应用背景,并在图片风格下启用玻璃质感面板与相关 UI 适配;同时顺带对设置项 schema 做了按分类拆分的结构化重构,并对歌词渲染/部分 UI 组件样式做了调整。

Changes:

  • 新增图片背景外观:主进程提供选图 IPC + 缓存到 app-cache/backgrounds,渲染端新增 AppBackground 与主题 store 状态(appearanceStyle / imageBackground / 取色)。
  • 全局样式与组件适配图片风格(bg-app、玻璃面板/表单底色、浮动布局播放栏等)。
  • 设置项 schema 拆分到 src/settings/categories/*,并增强子项隐藏能力(hideChildren);同时改进歌词渲染器时间/动画冻结恢复逻辑。

Reviewed changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
uno.config.ts 增加 glass-panelbg-field UnoCSS shortcuts,支撑图片背景下的玻璃/表单底色一致性
src/utils/color.ts 调整浅色 surfaceAlt,并新增从图片 URL 提取主色的 Promise API
src/types/theme.ts 新增图片背景相关类型(AppearanceStyle / ImageBackgroundConfig)
src/types/settings-schema.ts 文档注释整理,并新增 hideChildren 以支持子项完全隐藏
src/styles/global.css 引入 --s-app-bg 与 image 风格下的背景/面板/弹层/表单控件样式策略
src/stores/theme.ts 增加图片背景状态、有效风格/颜色计算、启动与 src 变化时的取色流程、持久化字段扩展
src/settings/schema.ts settings schema 改为聚合各 category 文件,提升可维护性
src/settings/categories/general.ts general 分类拆分落地
src/settings/categories/appearance.ts appearance 分类拆分并新增“外观风格/背景参数”设置项
src/settings/categories/player.ts player 分类拆分落地
src/settings/categories/lyric.ts lyric 分类拆分落地
src/settings/categories/externalLyric.ts externalLyric 分类拆分并保留 Windows 条件 section
src/settings/categories/hotkeys.ts hotkeys 分类拆分落地
src/settings/categories/services.ts services 分类拆分落地
src/settings/categories/plugins.ts plugins 分类拆分落地
src/layouts/MainLayout.vue 主容器改用 bg-app,并调整播放栏结构与浮动布局玻璃样式
src/layouts/components/NavHeader.vue 顶部菜单在图片风格下禁用主题切换入口
src/i18n/locales/zh-CN.json 新增外观风格与背景参数文案,并调整主题色来源措辞
src/i18n/locales/en-US.json 同步新增外观风格与背景参数文案,并调整主题色来源措辞
src/components/Versions.vue 删除版本展示组件
src/components/ui/SVirtualList.vue 调整空态/头部 slot 布局与滚动视口高度测量方式
src/components/ui/SSelect.vue 表单底色改用 bg-field 并用 ring 替代 shadow 表达 focus
src/components/ui/SMenu.vue 调整非选中项文字色
src/components/ui/SCombobox.vue 表单底色改用 bg-field 并用 ring 替代 shadow 表达 open 状态
src/components/settings/SettingsItem.vue 支持 hideChildren:子项在不激活时可完全不渲染
src/components/settings/custom/HotkeyConfig.vue 结构微调并用 SDivider 分隔行
src/components/settings/custom/FontConfig.vue SCard 替换手写卡片容器样式
src/components/settings/custom/BackgroundImagePicker.vue 新增背景图片选择/预览/清除的自定义设置组件
src/components/player/Lyrics/engine/index.ts 修复/增强渲染器复用清理、冻结/恢复动画同步、deltaTime 夹紧等逻辑
src/components/list/SongList.vue 浮动播放栏存在时调整“滚动到播放中”按钮 bottom 偏移
src/components/AppBackground.vue 新增全局背景渲染层(图片 + blur/scale + dim overlay)
src/App.vue 注入 AppBackground 到应用根部
electron/preload/index.ts 新增 window.api.theme(选图、清理背景缓存)
electron/preload/index.d.ts 补充 window.api.theme 类型声明
electron/main/ipc/theme.ts 新增主进程 IPC:选图并复制到缓存目录,支持清空背景缓存
electron/main/ipc/index.ts 注册 theme IPC handlers
components.d.ts 组件类型声明更新(AppBackground、BackgroundImagePicker)

Comment thread src/stores/theme.ts
Comment thread src/stores/theme.ts
Comment thread src/settings/categories/appearance.ts
Comment thread src/settings/categories/appearance.ts
Comment thread src/layouts/components/NavHeader.vue
Comment thread src/components/settings/custom/BackgroundImagePicker.vue Outdated
Comment thread src/components/player/Lyrics/engine/index.ts
Comment thread src/components/settings/custom/BackgroundImagePicker.vue
@imsyy imsyy merged commit 95ed1db into dev May 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants