Skip to content

Fix switch toggle UI updates and subtitle selection in player settings menu#252

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-subtitle-options-bug
Draft

Fix switch toggle UI updates and subtitle selection in player settings menu#252
Copilot wants to merge 2 commits intomainfrom
copilot/fix-subtitle-options-bug

Conversation

Copy link

Copilot AI commented Dec 14, 2025

The "More Options" menu had two issues: switches (高能进度条, 弹幕) didn't update UI on toggle, and the subtitle option opened a settings dialog instead of a direct selection menu like playback speed.

Changes

  • Wrapped SwitchListTile in Obx: Enables reactive UI updates when GetX observable values change
// Before: UI doesn't update when value changes
SwitchListTile(
  value: plPlayerController.enableShowDanmaku.value,
  onChanged: (value) { ... },
)

// After: UI reacts to state changes
Obx(
  () => SwitchListTile(
    value: plPlayerController.enableShowDanmaku.value,
    onChanged: (value) { ... },
  ),
)
  • Added showSelectSubtitle() method: Displays bottom sheet with direct subtitle selection (关闭字幕 + available subtitles), matching the pattern of showSetSpeed() and the player controls subtitle button (view.dart:660)

  • Updated subtitle menu item: Now calls showSelectSubtitle() for immediate selection instead of showSetSubtitle() which opens a styling settings dialog

Original prompt

This section details on the original issue you should resolve

<issue_title>fix</issue_title>
<issue_description>播放器更多选项的字幕选项在https://github.com/UcnacDx2/PiliPlus/pull/232会错意了

更多选项的字幕是lib/plugin/pl_player/view.dart里字幕的相同功能

他应该像播放速度那样,在菜单里实现

以及:
播放器上更多选项,预期是像lib/plugin/pl_player/view.dart上的按钮一样即点即切换,目前不是这样,修复一下
现在是:若ui状态为开,点一次实际切换为关,但ui没变动,此时若想再次操作开关均无反应
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: UcnacDx2 <127503808+UcnacDx2@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix subtitle options behavior in player settings Fix switch toggle UI updates and subtitle selection in player settings menu Dec 14, 2025
Copilot AI requested a review from UcnacDx2 December 14, 2025 15:43
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.

fix

2 participants

Comments