From 74f0fb471c7efdf3c750b9e0dbea26ed88120870 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 4 Oct 2025 12:38:23 +0800 Subject: [PATCH] fix thumbGlowColor Signed-off-by: bggRGjQaUbCoE --- .../widgets/progress_bar/audio_video_progress_bar.dart | 8 ++++---- lib/plugin/pl_player/view.dart | 2 ++ lib/plugin/pl_player/widgets/bottom_control.dart | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/common/widgets/progress_bar/audio_video_progress_bar.dart b/lib/common/widgets/progress_bar/audio_video_progress_bar.dart index d67b890a..467ff1c9 100644 --- a/lib/common/widgets/progress_bar/audio_video_progress_bar.dart +++ b/lib/common/widgets/progress_bar/audio_video_progress_bar.dart @@ -43,7 +43,7 @@ class ProgressBar extends LeafRenderObjectWidget { this.barCapShape = BarCapShape.round, this.thumbRadius = 10.0, required this.thumbColor, - this.thumbGlowColor, + required this.thumbGlowColor, this.thumbGlowRadius = 30.0, this.thumbCanPaintOutsideBar = true, }); @@ -154,7 +154,7 @@ class ProgressBar extends LeafRenderObjectWidget { /// The color of the pressed-down effect of the moveable progress bar thumb. /// /// By default it is [thumbColor] with an alpha value of 80. - final Color? thumbGlowColor; + final Color thumbGlowColor; /// The radius of the circle for the pressed-down effect of the moveable /// progress bar thumb. @@ -196,7 +196,7 @@ class ProgressBar extends LeafRenderObjectWidget { barCapShape: barCapShape, thumbRadius: thumbRadius, thumbColor: thumbColor, - thumbGlowColor: thumbGlowColor ?? thumbColor, + thumbGlowColor: thumbGlowColor, thumbGlowRadius: thumbGlowRadius, thumbCanPaintOutsideBar: thumbCanPaintOutsideBar, ); @@ -219,7 +219,7 @@ class ProgressBar extends LeafRenderObjectWidget { ..barCapShape = barCapShape ..thumbRadius = thumbRadius ..thumbColor = thumbColor - ..thumbGlowColor = thumbGlowColor ?? thumbColor + ..thumbGlowColor = thumbGlowColor ..thumbGlowRadius = thumbGlowRadius ..thumbCanPaintOutsideBar = thumbCanPaintOutsideBar; } diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index acc20403..ca5578ed 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -1083,6 +1083,7 @@ class _PLVideoPlayerState extends State maxWidth = widget.maxWidth; maxHeight = widget.maxHeight; final Color primary = theme.colorScheme.primary; + late final thumbGlowColor = primary.withAlpha(80); late final bufferedBarColor = primary.withValues(alpha: 0.4); const TextStyle textStyle = TextStyle( color: Colors.white, @@ -1507,6 +1508,7 @@ class _PLVideoPlayerState extends State baseBarColor: const Color(0x33FFFFFF), bufferedBarColor: bufferedBarColor, thumbColor: primary, + thumbGlowColor: thumbGlowColor, barHeight: 3.5, thumbRadius: 2.5, ); diff --git a/lib/plugin/pl_player/widgets/bottom_control.dart b/lib/plugin/pl_player/widgets/bottom_control.dart index 78564661..0aa1d190 100644 --- a/lib/plugin/pl_player/widgets/bottom_control.dart +++ b/lib/plugin/pl_player/widgets/bottom_control.dart @@ -31,6 +31,7 @@ class BottomControl extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); Color primary = theme.colorScheme.primary; + final thumbGlowColor = primary.withAlpha(80); final bufferedBarColor = primary.withValues(alpha: 0.4); //阅读器限制 Timer? accessibilityDebounce; @@ -109,6 +110,7 @@ class BottomControl extends StatelessWidget { baseBarColor: const Color(0x33FFFFFF), bufferedBarColor: bufferedBarColor, thumbColor: primary, + thumbGlowColor: thumbGlowColor, barHeight: 3.5, thumbRadius: 7, onDragStart: onDragStart,