mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: subtitle stroke
Closes #446 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1042,6 +1042,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
int subtitlePaddingH = widget.controller.subtitlePaddingH;
|
||||
int subtitlePaddingB = widget.controller.subtitlePaddingB;
|
||||
double subtitleBgOpaticy = widget.controller.subtitleBgOpaticy;
|
||||
double subtitleStrokeWidth = widget.controller.subtitleStrokeWidth;
|
||||
|
||||
final sliderTheme = SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
@@ -1057,6 +1058,15 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
padding: isFullScreen ? 70 : null,
|
||||
child: StatefulBuilder(
|
||||
builder: (_, setState) {
|
||||
void updateStrokeWidth(double val) {
|
||||
subtitleStrokeWidth = val;
|
||||
widget.controller
|
||||
..subtitleStrokeWidth = subtitleStrokeWidth
|
||||
..updateSubtitleStyle()
|
||||
..putDanmakuSettings();
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void updateOpacity(double val) {
|
||||
subtitleBgOpaticy = val;
|
||||
widget.controller
|
||||
@@ -1178,6 +1188,32 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('描边粗细 $subtitleStrokeWidth'),
|
||||
resetBtn(1.5, () => updateStrokeWidth(1.5)),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 0,
|
||||
bottom: 6,
|
||||
left: 10,
|
||||
right: 10,
|
||||
),
|
||||
child: SliderTheme(
|
||||
data: sliderTheme,
|
||||
child: Slider(
|
||||
min: 0,
|
||||
max: 3,
|
||||
value: subtitleStrokeWidth,
|
||||
divisions: 6,
|
||||
label: '$subtitleStrokeWidth',
|
||||
onChanged: updateStrokeWidth,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user