feat: custom subtitle bg stroke

Closes #90

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-03 11:17:57 +08:00
parent 1232116d22
commit 168bb22670
4 changed files with 55 additions and 4 deletions

View File

@@ -292,7 +292,7 @@ class _HeaderControlState extends State<HeaderControl> {
onTap: () => {Get.back(), showSetDanmaku()},
leading:
const Icon(Icons.subtitles_outlined, size: 20),
title: const Text('弹幕设置', style: titleStyle),
title: const Text('弹幕/字幕设置', style: titleStyle),
),
ListTile(
dense: true,
@@ -1025,6 +1025,7 @@ class _HeaderControlState extends State<HeaderControl> {
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;
@@ -1058,7 +1059,7 @@ class _HeaderControlState extends State<HeaderControl> {
children: [
const SizedBox(
height: 45,
child: Center(child: Text('弹幕设置', style: titleStyle)),
child: Center(child: Text('弹幕/字幕设置', style: titleStyle)),
),
const SizedBox(height: 10),
Row(
@@ -1649,6 +1650,40 @@ class _HeaderControlState extends State<HeaderControl> {
),
),
),
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(() {});
},
),
),
),
],
),
),