From 2aa109b0897aa57e163d5e465f2637bb4f3dcda2 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sun, 5 Jan 2025 12:14:34 +0800 Subject: [PATCH] Revert "feat: custom subtitle bg stroke" This reverts commit 168bb226705d3da197b48cf5d592df230fc25626. --- .../video/detail/widgets/header_control.dart | 35 ------------------- lib/plugin/pl_player/controller.dart | 13 +------ lib/utils/storage.dart | 4 --- 3 files changed, 1 insertion(+), 51 deletions(-) diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index 20dfb6da..995babe5 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -1025,7 +1025,6 @@ class _HeaderControlState extends State { int subtitlePaddingH = widget.controller.subtitlePaddingH; int subtitlePaddingB = widget.controller.subtitlePaddingB; double subtitleBgOpaticy = widget.controller.subtitleBgOpaticy; - double subtitleBgStroke = widget.controller.subtitleBgStroke; final DanmakuController? danmakuController = widget.controller.danmakuController; @@ -1650,40 +1649,6 @@ class _HeaderControlState extends State { ), ), ), - Text('字幕背景边框粗细(背景不透明度为0时启用) $subtitleBgStroke'), - Padding( - padding: const EdgeInsets.only( - top: 0, - bottom: 6, - left: 10, - right: 10, - ), - child: SliderTheme( - data: SliderThemeData( - trackShape: MSliderTrackShape(), - thumbColor: Theme.of(context).colorScheme.primary, - activeTrackColor: Theme.of(context).colorScheme.primary, - trackHeight: 10, - thumbShape: const RoundSliderThumbShape( - enabledThumbRadius: 6.0), - ), - child: Slider( - min: 0, - max: 3, - divisions: 6, - value: subtitleBgStroke, - label: '$subtitleBgStroke', - onChanged: (double val) { - subtitleBgStroke = val; - widget.controller - ..subtitleBgStroke = subtitleBgStroke - ..updateSubtitleStyle() - ..putDanmakuSettings(); - setState(() {}); - }, - ), - ), - ), ], ), ), diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 527ff0f4..da471997 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -260,18 +260,12 @@ class PlPlayerController { late int subtitlePaddingH = GStorage.subtitlePaddingH; late int subtitlePaddingB = GStorage.subtitlePaddingB; late double subtitleBgOpaticy = GStorage.subtitleBgOpaticy; - late double subtitleBgStroke = GStorage.subtitleBgStroke; // 播放顺序相关 PlayRepeat playRepeat = PlayRepeat.pause; final GlobalKey key = GlobalKey(); - Paint get subtitleBg => Paint() - ..style = PaintingStyle.stroke - ..strokeWidth = subtitleBgStroke - ..color = Colors.black; - TextStyle get subTitleStyle => TextStyle( height: 1.5, fontSize: @@ -280,11 +274,7 @@ class PlPlayerController { wordSpacing: 0.1, color: Colors.white, fontWeight: FontWeight.normal, - background: - subtitleBgOpaticy == 0 && subtitleBgStroke != 0 ? subtitleBg : null, - backgroundColor: subtitleBgOpaticy == 0 - ? null - : Colors.black.withOpacity(subtitleBgOpaticy), + backgroundColor: Colors.black.withOpacity(subtitleBgOpaticy), ); SubtitleViewConfiguration get subtitleViewConfiguration => @@ -1350,7 +1340,6 @@ class PlPlayerController { setting.put(SettingBoxKey.subtitlePaddingH, subtitlePaddingH); setting.put(SettingBoxKey.subtitlePaddingB, subtitlePaddingB); setting.put(SettingBoxKey.subtitleBgOpaticy, subtitleBgOpaticy); - setting.put(SettingBoxKey.subtitleBgStroke, subtitleBgStroke); } Future dispose({String type = 'single'}) async { diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index dfdf697c..5e674b0d 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -281,9 +281,6 @@ class GStorage { static double get subtitleBgOpaticy => setting.get(SettingBoxKey.subtitleBgOpaticy, defaultValue: 0.67); - static double get subtitleBgStroke => - setting.get(SettingBoxKey.subtitleBgStroke, defaultValue: 0.0); - static bool get badCertificateCallback => setting.get(SettingBoxKey.badCertificateCallback, defaultValue: false); @@ -496,7 +493,6 @@ class SettingBoxKey { subtitlePaddingH = 'subtitlePaddingH', subtitlePaddingB = 'subtitlePaddingB', subtitleBgOpaticy = 'subtitleBgOpaticy', - subtitleBgStroke = 'subtitleBgStroke', badCertificateCallback = 'badCertificateCallback', continuePlayingPart = 'continuePlayingPart',