mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
fix reset sub/dm settings
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -159,7 +159,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
|||||||
},
|
},
|
||||||
option: DanmakuOption(
|
option: DanmakuOption(
|
||||||
fontSize: _fontSize,
|
fontSize: _fontSize,
|
||||||
fontWeight: playerController.fontWeight,
|
fontWeight: playerController.danmakuFontWeight,
|
||||||
area: playerController.showArea,
|
area: playerController.showArea,
|
||||||
opacity: playerController.danmakuOpacity,
|
opacity: playerController.danmakuOpacity,
|
||||||
hideTop: playerController.blockTypes.contains(5),
|
hideTop: playerController.blockTypes.contains(5),
|
||||||
@@ -171,7 +171,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
|||||||
staticDuration:
|
staticDuration:
|
||||||
playerController.danmakuStaticDuration /
|
playerController.danmakuStaticDuration /
|
||||||
playerController.playbackSpeed,
|
playerController.playbackSpeed,
|
||||||
strokeWidth: playerController.strokeWidth,
|
strokeWidth: playerController.danmakuStrokeWidth,
|
||||||
lineHeight: playerController.danmakuLineHeight,
|
lineHeight: playerController.danmakuLineHeight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1031,7 +1031,7 @@ class _LiveDanmakuState extends State<LiveDanmaku> {
|
|||||||
},
|
},
|
||||||
option: DanmakuOption(
|
option: DanmakuOption(
|
||||||
fontSize: _fontSize,
|
fontSize: _fontSize,
|
||||||
fontWeight: plPlayerController.fontWeight,
|
fontWeight: plPlayerController.danmakuFontWeight,
|
||||||
area: plPlayerController.showArea,
|
area: plPlayerController.showArea,
|
||||||
opacity: plPlayerController.danmakuOpacity,
|
opacity: plPlayerController.danmakuOpacity,
|
||||||
hideTop: plPlayerController.blockTypes.contains(5),
|
hideTop: plPlayerController.blockTypes.contains(5),
|
||||||
@@ -1043,7 +1043,7 @@ class _LiveDanmakuState extends State<LiveDanmaku> {
|
|||||||
staticDuration:
|
staticDuration:
|
||||||
plPlayerController.danmakuStaticDuration /
|
plPlayerController.danmakuStaticDuration /
|
||||||
plPlayerController.playbackSpeed,
|
plPlayerController.playbackSpeed,
|
||||||
strokeWidth: plPlayerController.strokeWidth,
|
strokeWidth: plPlayerController.danmakuStrokeWidth,
|
||||||
lineHeight: plPlayerController.danmakuLineHeight,
|
lineHeight: plPlayerController.danmakuLineHeight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1031,7 +1031,12 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
Text(
|
Text(
|
||||||
'字体大小 ${(subtitleFontScale * 100).toStringAsFixed(1)}%',
|
'字体大小 ${(subtitleFontScale * 100).toStringAsFixed(1)}%',
|
||||||
),
|
),
|
||||||
resetBtn(theme, '100.0%', () => updateFontScale(1.0)),
|
resetBtn(
|
||||||
|
theme,
|
||||||
|
'100.0%',
|
||||||
|
() => updateFontScale(1.0),
|
||||||
|
isDanmaku: false,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -1062,7 +1067,12 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
Text(
|
Text(
|
||||||
'全屏字体大小 ${(subtitleFontScaleFS * 100).toStringAsFixed(1)}%',
|
'全屏字体大小 ${(subtitleFontScaleFS * 100).toStringAsFixed(1)}%',
|
||||||
),
|
),
|
||||||
resetBtn(theme, '150.0%', () => updateFontScaleFS(1.5)),
|
resetBtn(
|
||||||
|
theme,
|
||||||
|
'150.0%',
|
||||||
|
() => updateFontScaleFS(1.5),
|
||||||
|
isDanmaku: false,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -1091,7 +1101,12 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('字体粗细 ${subtitleFontWeight + 1}(可能无法精确调节)'),
|
Text('字体粗细 ${subtitleFontWeight + 1}(可能无法精确调节)'),
|
||||||
resetBtn(theme, 6, () => updateFontWeight(5)),
|
resetBtn(
|
||||||
|
theme,
|
||||||
|
6,
|
||||||
|
() => updateFontWeight(5),
|
||||||
|
isDanmaku: false,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -1119,7 +1134,12 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('描边粗细 $subtitleStrokeWidth'),
|
Text('描边粗细 $subtitleStrokeWidth'),
|
||||||
resetBtn(theme, 2.0, () => updateStrokeWidth(2.0)),
|
resetBtn(
|
||||||
|
theme,
|
||||||
|
2.0,
|
||||||
|
() => updateStrokeWidth(2.0),
|
||||||
|
isDanmaku: false,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -1147,7 +1167,12 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('左右边距 $subtitlePaddingH'),
|
Text('左右边距 $subtitlePaddingH'),
|
||||||
resetBtn(theme, 24, () => updateHorizontalPadding(24)),
|
resetBtn(
|
||||||
|
theme,
|
||||||
|
24,
|
||||||
|
() => updateHorizontalPadding(24),
|
||||||
|
isDanmaku: false,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -1175,7 +1200,12 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('底部边距 $subtitlePaddingB'),
|
Text('底部边距 $subtitlePaddingB'),
|
||||||
resetBtn(theme, 24, () => updateBottomPadding(24)),
|
resetBtn(
|
||||||
|
theme,
|
||||||
|
24,
|
||||||
|
() => updateBottomPadding(24),
|
||||||
|
isDanmaku: false,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -1203,7 +1233,12 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('背景不透明度 ${(subtitleBgOpaticy * 100).toInt()}%'),
|
Text('背景不透明度 ${(subtitleBgOpaticy * 100).toInt()}%'),
|
||||||
resetBtn(theme, '67%', () => updateOpacity(0.67)),
|
resetBtn(
|
||||||
|
theme,
|
||||||
|
'67%',
|
||||||
|
() => updateOpacity(0.67),
|
||||||
|
isDanmaku: false,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -1234,12 +1269,24 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget resetBtn(ThemeData theme, Object def, VoidCallback onPressed) {
|
Widget resetBtn(
|
||||||
|
ThemeData theme,
|
||||||
|
Object def,
|
||||||
|
VoidCallback onPressed, {
|
||||||
|
bool isDanmaku = true,
|
||||||
|
}) {
|
||||||
return iconButton(
|
return iconButton(
|
||||||
context: context,
|
context: context,
|
||||||
tooltip: '默认值: $def',
|
tooltip: '默认值: $def',
|
||||||
icon: Icons.refresh,
|
icon: Icons.refresh,
|
||||||
onPressed: onPressed,
|
onPressed: () {
|
||||||
|
onPressed();
|
||||||
|
if (isDanmaku) {
|
||||||
|
plPlayerController.putDanmakuSettings();
|
||||||
|
} else {
|
||||||
|
plPlayerController.putSubtitleSettings();
|
||||||
|
}
|
||||||
|
},
|
||||||
bgColor: Colors.transparent,
|
bgColor: Colors.transparent,
|
||||||
iconColor: theme.colorScheme.outline,
|
iconColor: theme.colorScheme.outline,
|
||||||
size: 24,
|
size: 24,
|
||||||
@@ -1262,19 +1309,19 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
// 显示区域
|
// 显示区域
|
||||||
double showArea = plPlayerController.showArea;
|
double showArea = plPlayerController.showArea;
|
||||||
// 不透明度
|
// 不透明度
|
||||||
double opacity = plPlayerController.danmakuOpacity;
|
double danmakuOpacity = plPlayerController.danmakuOpacity;
|
||||||
// 字体大小
|
// 字体大小
|
||||||
double fontSize = plPlayerController.danmakuFontScale;
|
double danmakuFontScale = plPlayerController.danmakuFontScale;
|
||||||
// 全屏字体大小
|
// 全屏字体大小
|
||||||
double fontSizeFS = plPlayerController.danmakuFontScaleFS;
|
double danmakuFontScaleFS = plPlayerController.danmakuFontScaleFS;
|
||||||
double danmakuLineHeight = plPlayerController.danmakuLineHeight;
|
double danmakuLineHeight = plPlayerController.danmakuLineHeight;
|
||||||
// 弹幕速度
|
// 弹幕速度
|
||||||
double danmakuDuration = plPlayerController.danmakuDuration;
|
double danmakuDuration = plPlayerController.danmakuDuration;
|
||||||
double danmakuStaticDuration = plPlayerController.danmakuStaticDuration;
|
double danmakuStaticDuration = plPlayerController.danmakuStaticDuration;
|
||||||
// 弹幕描边
|
// 弹幕描边
|
||||||
double strokeWidth = plPlayerController.strokeWidth;
|
double danmakuStrokeWidth = plPlayerController.danmakuStrokeWidth;
|
||||||
// 字体粗细
|
// 字体粗细
|
||||||
int fontWeight = plPlayerController.fontWeight;
|
int danmakuFontWeight = plPlayerController.danmakuFontWeight;
|
||||||
bool massiveMode = plPlayerController.massiveMode;
|
bool massiveMode = plPlayerController.massiveMode;
|
||||||
|
|
||||||
final DanmakuController? danmakuController =
|
final DanmakuController? danmakuController =
|
||||||
@@ -1294,7 +1341,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
void updateLineHeight(double val) {
|
void updateLineHeight(double val) {
|
||||||
danmakuLineHeight = val.toPrecision(1);
|
plPlayerController.danmakuLineHeight = danmakuLineHeight = val
|
||||||
|
.toPrecision(1);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
@@ -1306,7 +1354,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateDuration(double val) {
|
void updateDuration(double val) {
|
||||||
danmakuDuration = val.toPrecision(1);
|
plPlayerController.danmakuDuration = danmakuDuration = val
|
||||||
|
.toPrecision(1);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
@@ -1318,7 +1367,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateStaticDuration(double val) {
|
void updateStaticDuration(double val) {
|
||||||
danmakuStaticDuration = val.toPrecision(1);
|
plPlayerController.danmakuStaticDuration = danmakuStaticDuration = val
|
||||||
|
.toPrecision(1);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
@@ -1331,13 +1381,13 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateFontSizeFS(double val) {
|
void updateFontSizeFS(double val) {
|
||||||
fontSizeFS = val;
|
plPlayerController.danmakuFontScaleFS = danmakuFontScaleFS = val;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
if (isFullScreen) {
|
if (isFullScreen) {
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
danmakuController.option.copyWith(
|
danmakuController.option.copyWith(
|
||||||
fontSize: (15 * fontSizeFS).toDouble(),
|
fontSize: (15 * danmakuFontScaleFS).toDouble(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
@@ -1345,13 +1395,13 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateFontSize(double val) {
|
void updateFontSize(double val) {
|
||||||
fontSize = val;
|
plPlayerController.danmakuFontScale = danmakuFontScale = val;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
if (!isFullScreen) {
|
if (!isFullScreen) {
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
danmakuController.option.copyWith(
|
danmakuController.option.copyWith(
|
||||||
fontSize: (15 * fontSize).toDouble(),
|
fontSize: (15 * danmakuFontScale).toDouble(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
@@ -1359,37 +1409,40 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateStrokeWidth(double val) {
|
void updateStrokeWidth(double val) {
|
||||||
strokeWidth = val;
|
plPlayerController.danmakuStrokeWidth = danmakuStrokeWidth = val;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
danmakuController.option.copyWith(strokeWidth: val),
|
danmakuController.option.copyWith(
|
||||||
|
strokeWidth: danmakuStrokeWidth,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateFontWeight(double val) {
|
void updateFontWeight(double val) {
|
||||||
fontWeight = val.toInt();
|
plPlayerController.danmakuFontWeight = danmakuFontWeight = val
|
||||||
|
.toInt();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
danmakuController.option.copyWith(fontWeight: fontWeight),
|
danmakuController.option.copyWith(fontWeight: danmakuFontWeight),
|
||||||
);
|
);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateOpacity(double val) {
|
void updateOpacity(double val) {
|
||||||
opacity = val;
|
plPlayerController.danmakuOpacity = danmakuOpacity = val;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
danmakuController.option.copyWith(opacity: val),
|
danmakuController.option.copyWith(opacity: danmakuOpacity),
|
||||||
);
|
);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateShowArea(double val) {
|
void updateShowArea(double val) {
|
||||||
showArea = val.toPrecision(1);
|
plPlayerController.showArea = showArea = val.toPrecision(1);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
danmakuController?.updateOption(
|
danmakuController?.updateOption(
|
||||||
@@ -1399,7 +1452,7 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateDanmakuWeight(double val) {
|
void updateDanmakuWeight(double val) {
|
||||||
danmakuWeight = val.toInt();
|
plPlayerController.danmakuWeight = danmakuWeight = val.toInt();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1457,9 +1510,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
divisions: 10,
|
divisions: 10,
|
||||||
label: '$danmakuWeight',
|
label: '$danmakuWeight',
|
||||||
onChanged: updateDanmakuWeight,
|
onChanged: updateDanmakuWeight,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..danmakuWeight = danmakuWeight
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1540,16 +1592,15 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
divisions: 9,
|
divisions: 9,
|
||||||
label: '${showArea * 100}%',
|
label: '${showArea * 100}%',
|
||||||
onChanged: updateShowArea,
|
onChanged: updateShowArea,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..showArea = showArea
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('不透明度 ${opacity * 100}%'),
|
Text('不透明度 ${danmakuOpacity * 100}%'),
|
||||||
resetBtn(theme, '100.0%', () => updateOpacity(1.0)),
|
resetBtn(theme, '100.0%', () => updateOpacity(1.0)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1565,20 +1616,19 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
child: Slider(
|
child: Slider(
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 1,
|
max: 1,
|
||||||
value: opacity,
|
value: danmakuOpacity,
|
||||||
divisions: 10,
|
divisions: 10,
|
||||||
label: '${opacity * 100}%',
|
label: '${danmakuOpacity * 100}%',
|
||||||
onChanged: updateOpacity,
|
onChanged: updateOpacity,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..danmakuOpacity = opacity
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('字体粗细 ${fontWeight + 1}(可能无法精确调节)'),
|
Text('字体粗细 ${danmakuFontWeight + 1}(可能无法精确调节)'),
|
||||||
resetBtn(theme, 6, () => updateFontWeight(5)),
|
resetBtn(theme, 6, () => updateFontWeight(5)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1594,20 +1644,19 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
child: Slider(
|
child: Slider(
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 8,
|
max: 8,
|
||||||
value: fontWeight.toDouble(),
|
value: danmakuFontWeight.toDouble(),
|
||||||
divisions: 8,
|
divisions: 8,
|
||||||
label: '${fontWeight + 1}',
|
label: '${danmakuFontWeight + 1}',
|
||||||
onChanged: updateFontWeight,
|
onChanged: updateFontWeight,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..fontWeight = fontWeight
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('描边粗细 $strokeWidth'),
|
Text('描边粗细 $danmakuStrokeWidth'),
|
||||||
resetBtn(theme, 1.5, () => updateStrokeWidth(1.5)),
|
resetBtn(theme, 1.5, () => updateStrokeWidth(1.5)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1623,20 +1672,21 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
child: Slider(
|
child: Slider(
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 5,
|
max: 5,
|
||||||
value: strokeWidth,
|
value: danmakuStrokeWidth,
|
||||||
divisions: 10,
|
divisions: 10,
|
||||||
label: '$strokeWidth',
|
label: '$danmakuStrokeWidth',
|
||||||
onChanged: updateStrokeWidth,
|
onChanged: updateStrokeWidth,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..strokeWidth = strokeWidth
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('字体大小 ${(fontSize * 100).toStringAsFixed(1)}%'),
|
Text(
|
||||||
|
'字体大小 ${(danmakuFontScale * 100).toStringAsFixed(1)}%',
|
||||||
|
),
|
||||||
resetBtn(theme, '100.0%', () => updateFontSize(1.0)),
|
resetBtn(theme, '100.0%', () => updateFontSize(1.0)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1652,20 +1702,22 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
child: Slider(
|
child: Slider(
|
||||||
min: 0.5,
|
min: 0.5,
|
||||||
max: 2.5,
|
max: 2.5,
|
||||||
value: fontSize,
|
value: danmakuFontScale,
|
||||||
divisions: 20,
|
divisions: 20,
|
||||||
label: '${(fontSize * 100).toStringAsFixed(1)}%',
|
label:
|
||||||
|
'${(danmakuFontScale * 100).toStringAsFixed(1)}%',
|
||||||
onChanged: updateFontSize,
|
onChanged: updateFontSize,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..danmakuFontScale = fontSize
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text('全屏字体大小 ${(fontSizeFS * 100).toStringAsFixed(1)}%'),
|
Text(
|
||||||
|
'全屏字体大小 ${(danmakuFontScaleFS * 100).toStringAsFixed(1)}%',
|
||||||
|
),
|
||||||
resetBtn(theme, '120.0%', () => updateFontSizeFS(1.2)),
|
resetBtn(theme, '120.0%', () => updateFontSizeFS(1.2)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1681,13 +1733,13 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
child: Slider(
|
child: Slider(
|
||||||
min: 0.5,
|
min: 0.5,
|
||||||
max: 2.5,
|
max: 2.5,
|
||||||
value: fontSizeFS,
|
value: danmakuFontScaleFS,
|
||||||
divisions: 20,
|
divisions: 20,
|
||||||
label: '${(fontSizeFS * 100).toStringAsFixed(1)}%',
|
label:
|
||||||
|
'${(danmakuFontScaleFS * 100).toStringAsFixed(1)}%',
|
||||||
onChanged: updateFontSizeFS,
|
onChanged: updateFontSizeFS,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..danmakuFontScaleFS = fontSizeFS
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1714,9 +1766,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
divisions: 49,
|
divisions: 49,
|
||||||
label: danmakuDuration.toString(),
|
label: danmakuDuration.toString(),
|
||||||
onChanged: updateDuration,
|
onChanged: updateDuration,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..danmakuDuration = danmakuDuration
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1743,9 +1794,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
divisions: 49,
|
divisions: 49,
|
||||||
label: danmakuStaticDuration.toString(),
|
label: danmakuStaticDuration.toString(),
|
||||||
onChanged: updateStaticDuration,
|
onChanged: updateStaticDuration,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..danmakuStaticDuration = danmakuStaticDuration
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1770,9 +1820,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
|||||||
max: 3.0,
|
max: 3.0,
|
||||||
value: danmakuLineHeight,
|
value: danmakuLineHeight,
|
||||||
onChanged: updateLineHeight,
|
onChanged: updateLineHeight,
|
||||||
onChangeEnd: (_) => plPlayerController
|
onChangeEnd: (_) =>
|
||||||
..danmakuLineHeight = danmakuLineHeight
|
plPlayerController.putDanmakuSettings(),
|
||||||
..putDanmakuSettings(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -282,8 +282,8 @@ class PlPlayerController {
|
|||||||
late double danmakuOpacity = Pref.danmakuOpacity;
|
late double danmakuOpacity = Pref.danmakuOpacity;
|
||||||
late double danmakuFontScale = Pref.danmakuFontScale;
|
late double danmakuFontScale = Pref.danmakuFontScale;
|
||||||
late double danmakuFontScaleFS = Pref.danmakuFontScaleFS;
|
late double danmakuFontScaleFS = Pref.danmakuFontScaleFS;
|
||||||
late double strokeWidth = Pref.strokeWidth;
|
late double danmakuStrokeWidth = Pref.strokeWidth;
|
||||||
late int fontWeight = Pref.fontWeight;
|
late int danmakuFontWeight = Pref.fontWeight;
|
||||||
late bool massiveMode = Pref.danmakuMassiveMode;
|
late bool massiveMode = Pref.danmakuMassiveMode;
|
||||||
late double danmakuDuration = Pref.danmakuDuration;
|
late double danmakuDuration = Pref.danmakuDuration;
|
||||||
late double danmakuStaticDuration = Pref.danmakuStaticDuration;
|
late double danmakuStaticDuration = Pref.danmakuStaticDuration;
|
||||||
@@ -1562,8 +1562,8 @@ class PlPlayerController {
|
|||||||
SettingBoxKey.danmakuFontScaleFS: danmakuFontScaleFS,
|
SettingBoxKey.danmakuFontScaleFS: danmakuFontScaleFS,
|
||||||
SettingBoxKey.danmakuDuration: danmakuDuration,
|
SettingBoxKey.danmakuDuration: danmakuDuration,
|
||||||
SettingBoxKey.danmakuStaticDuration: danmakuStaticDuration,
|
SettingBoxKey.danmakuStaticDuration: danmakuStaticDuration,
|
||||||
SettingBoxKey.strokeWidth: strokeWidth,
|
SettingBoxKey.strokeWidth: danmakuStrokeWidth,
|
||||||
SettingBoxKey.fontWeight: fontWeight,
|
SettingBoxKey.fontWeight: danmakuFontWeight,
|
||||||
SettingBoxKey.danmakuLineHeight: danmakuLineHeight,
|
SettingBoxKey.danmakuLineHeight: danmakuLineHeight,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user