Repository navigation
feat(播放器): 拖动进度与音量时显示取值气泡 - #50
Merged
Merged
Conversation
Linecos
approved these changes
Nov 6, 2026
正在播放页的进度条原来只有底部两行「当前 / 总时长」,拖动过程中看不出正要 跳到哪儿;音量条更是全凭感觉。现在两条滑块都挂上 label,用框架自带的取值 气泡在圆点上方显示:进度给指尖指到的时间,音量给整数百分比。 气泡只在拖动期间出现(onDrag),松手即收,不占常驻空间;文字 12sp + 等宽 数字,跟着圆点跑时宽度不会抖。
Linecos
force-pushed
the
feat/slider-drag-value
branch
from
November 6, 2026 15:59
bb10fe9 to
9d1d906
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
正在播放页的两条滑块都挂上
label,拖动时在圆点上方出一个小气泡:进度条显示指尖指到的时间(02:13),音量条显示整数百分比(45)。只在拖动期间出现(ShowValueIndicator.onDrag),松手即收。为什么
进度条原来只有底部两行「当前 / 总时长」,拖动过程中看不出正要跳到哪儿——尤其是想从 1:20 拖到 3:40 这种。音量条更糟,120px 的小条上全凭手感。
样式照常见播放器的做法:小圆角气泡 + 底部一个小尖角指向圆点,12sp 等宽数字。等宽是刻意的——气泡跟着手指横向跑,用比例数字会让宽度一直变化、看着发抖。
影响范围
rust/src/api/{db,scan,player}.rs、rust/src/bass.rslib/src/features/player/now_playing_page.dart自查
.\scripts\check.ps1通过(analyze 零 issue、608 条测试全过、dart format 无改动;Rust 侧未涉及,cargo fmt / clippy / test 与本次改动无关)label取值,以及主题里的showValueIndicator == onDrag、字号 12flutter_rust_bridge_codegen generate给 reviewer 的备注
RectangularSliderValueIndicatorShape,没有自己写SliderComponentShape:气泡由OverlayPortal画在应用 Overlay 上,所以它不会跟着页面子树被裁剪,贴到两端时框架会自动做水平位移,不会跑出窗口。PaddleSliderValueIndicatorShape(那个水滴形),高度按 thumb 半径算能到 62px,放在 6px 圆点的音量条上太笨重,所以两条都统一用矩形气泡。scheme.inverseSurface/onInverseSurface这组,深浅主题自动反转,不额外引入新颜色。MaterialApp而不是页面(它在 Overlay 层)。要看的截图我可以补到 PR 评论里。