mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-21 06:52:18 +02:00
fix(player): size volume slider handle proportionally
This commit is contained in:
1 parent
23fe78f30d
commit
47ccf9c9ed
2 files changed
+8
-1
No files matched your search
@@ -16,6 +16,7 @@ class AppSlider extends StatelessWidget {
|
||||
this.label,
|
||||
this.semanticFormatterCallback,
|
||||
this.trackThickness,
|
||||
this.thumbLength,
|
||||
});
|
||||
|
||||
final double value;
|
||||
@@ -31,6 +32,10 @@ class AppSlider extends StatelessWidget {
|
||||
/// default extra-small track.
|
||||
final double? trackThickness;
|
||||
|
||||
/// Expressive handle height; shorten it together with a thinner track so
|
||||
/// the handle stays in proportion.
|
||||
final double? thumbLength;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!materialExpressiveEnabled(context)) {
|
||||
@@ -54,6 +59,7 @@ class AppSlider extends StatelessWidget {
|
||||
label: label,
|
||||
semanticFormatterCallback: semanticFormatterCallback,
|
||||
trackThickness: trackThickness,
|
||||
thumbLength: thumbLength,
|
||||
enabled: onChanged != null,
|
||||
onChanged: onChanged,
|
||||
onChangeEnd: onChangeEnd,
|
||||
|
||||
@@ -206,8 +206,9 @@ class _PlayerVolumeControlState extends ConsumerState<PlayerVolumeControl> {
|
||||
onPointerCancel: (_) => release(),
|
||||
child: AppSlider(
|
||||
// Thinner than the default track: volume stays secondary
|
||||
// to the seek bar above it.
|
||||
// to the seek bar above it. The handle shrinks with it.
|
||||
trackThickness: 8,
|
||||
thumbLength: 24,
|
||||
value: value,
|
||||
onChanged: enabled ? _setVolume : null,
|
||||
onChangeEnd: _setVolume,
|
||||
|
||||
Reference in new issue
Block a user