feat(任务栏歌词): 添加任务栏歌词边距,添加最小宽度 by WorldSansha · Pull Request #891 · imsyy/SPlayer

Summary of Changes

Hello @WorldSansha, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求引入了一项新功能,允许用户自定义任务栏歌词的边距。通过在设置中添加一个可配置的“歌词边距”选项,用户现在可以更灵活地调整任务栏歌词与屏幕边缘或其他UI元素之间的间距,从而提升了用户界面的可定制性和视觉体验。此更改涉及更新配置模型、IPC通信以及实际的窗口布局计算,以确保边距设置能够正确应用并持久化。

Highlights

  • 新增任务栏歌词边距设置: 引入了一个新的配置项,允许用户自定义任务栏歌词与相邻元素之间的间距。
  • 更新任务栏歌词布局逻辑: 任务栏歌词窗口的布局计算现在会考虑新的边距设置,确保视觉效果正确。
  • 集成到设置界面: 在歌词设置中添加了“歌词边距”的输入框,用户可以通过UI进行调整。
  • 配置同步与持久化: 新的边距设置已集成到应用的配置管理和IPC通信中,确保设置的持久化和跨进程同步。
Changelog
  • electron/main/ipc/ipc-taskbar.ts
    • 在获取任务栏配置时,为 margin 属性添加了默认值。
    • 更新了配置变更检测逻辑,当 margin 发生变化时会触发窗口布局更新。
  • electron/main/windows/taskbar-lyric-window.ts
    • 修改了 GAP 常量的计算方式,使其从存储中获取 taskbar.margin 值,而非固定值 10
  • src/components/Setting/config/lyric.ts
    • 在歌词设置中新增了一个名为“歌词边距”的输入框组件,允许用户调整任务栏歌词的边距,并设置了其最小值、最大值和步长。
  • src/composables/useInit.ts
    • settingStore.taskbarLyricMargin 添加到 watch 数组中,以便在边距设置改变时触发 updateTaskbarConfig
    • updateTaskbarConfig 调用中包含了新的 margin 属性。
  • src/stores/setting.ts
    • SettingState 接口中新增了 taskbarLyricMargin 属性及其JSDoc注释。
    • useSettingStorestate 中为 taskbarLyricMargin 设置了默认值 10
    • 调整了 songLevel 类型定义的格式。
  • src/types/shared/taskbar-ipc.ts
    • TaskbarConfig 接口中新增了 margin 属性。
  • src/utils/initIpc.ts
    • 在初始化IPC时,将 settingStore.taskbarLyricMargin 包含在发送给主进程的任务栏配置中。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.