Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Improve seek bar thumb visibility during drag

Nathan Poulsonc78be4a586c5
diff --git a/lib/widgets/absorb_slider.dart b/lib/widgets/absorb_slider.dart
index 552f1510..65a61778 100644
--- a/lib/widgets/absorb_slider.dart
+++ b/lib/widgets/absorb_slider.dart
@@ -283,8 +283,8 @@ class AbsorbProgressPainter extends CustomPainter {
}
// Thumb handle (tall rounded rect — style 4)
- final thumbWidth = isDragging ? 7.0 : 5.0;
- final thumbHeight = isDragging ? 32.0 : 26.0;
+ final thumbWidth = isDragging ? 10.0 : 5.0;
+ final thumbHeight = isDragging ? 34.0 : 26.0;
final thumbRect = RRect.fromRectAndRadius(
Rect.fromCenter(
center: Offset(progressX, centerY),
@@ -294,12 +294,20 @@ class AbsorbProgressPainter extends CustomPainter {
Radius.circular(thumbWidth / 2),
);
+ // Shadow
canvas.drawRRect(
thumbRect.shift(const Offset(0, 1)),
Paint()
..color = Colors.black.withValues(alpha: 0.3)
..maskFilter = const MaskFilter.blur(BlurStyle.normal, 3),
);
+ // White border when dragging for contrast
+ if (isDragging) {
+ canvas.drawRRect(
+ thumbRect.inflate(1.5),
+ Paint()..color = Colors.white,
+ );
+ }
canvas.drawRRect(thumbRect, Paint()..color = accent);
}
diff --git a/lib/widgets/card_progress_bar.dart b/lib/widgets/card_progress_bar.dart
index bbb1ae11..dc6423fc 100644
--- a/lib/widgets/card_progress_bar.dart
+++ b/lib/widgets/card_progress_bar.dart
@@ -483,6 +483,23 @@ class ChapterPillPainter extends CustomPainter {
..strokeWidth = 1.5
..strokeCap = StrokeCap.round,
);
+
+ // Thumb circle when dragging
+ if (isDragging) {
+ final center = Offset(lineX, h / 2);
+ // Shadow
+ canvas.drawCircle(
+ center + const Offset(0, 1),
+ 7,
+ Paint()
+ ..color = Colors.black.withValues(alpha: 0.3)
+ ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 3),
+ );
+ // White border
+ canvas.drawCircle(center, 7, Paint()..color = Colors.white);
+ // Accent fill
+ canvas.drawCircle(center, 5.5, Paint()..color = accent);
+ }
}
}