opt settings

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-05 18:11:02 +08:00
parent cfa925549e
commit 1ad710c1cf
8 changed files with 242 additions and 226 deletions

View File

@@ -23,6 +23,7 @@ import 'package:PiliPlus/models/video/play/url.dart';
import 'package:PiliPlus/models_new/video/video_play_info/subtitle.dart';
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
import 'package:PiliPlus/pages/danmaku/danmaku_model.dart';
import 'package:PiliPlus/pages/setting/widgets/popup_item.dart';
import 'package:PiliPlus/pages/setting/widgets/select_dialog.dart';
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/pages/video/introduction/local/controller.dart';
@@ -448,79 +449,25 @@ class HeaderControlState extends State<HeaderControl>
title: const Text('重载视频', style: titleStyle),
),
],
ListTile(
PopupListTile<SuperResolutionType>(
dense: true,
leading: const Icon(
Icons.stay_current_landscape_outlined,
size: 20,
),
title: Row(
children: [
const Text(
'超分辨率',
strutStyle: StrutStyle(leading: 0, height: 1),
style: TextStyle(
height: 1,
fontSize: 14,
),
),
const SizedBox(width: 10),
Builder(
builder: (context) => PopupMenuButton(
initialValue:
plPlayerController.superResolutionType.value,
child: Padding(
padding: const EdgeInsets.all(4),
child: Text.rich(
style: TextStyle(
height: 1,
fontSize: 14,
color: theme.colorScheme.secondary,
),
strutStyle: const StrutStyle(
leading: 0,
height: 1,
fontSize: 14,
),
TextSpan(
children: [
TextSpan(
text: widget
.controller
.superResolutionType
.value
.title,
),
WidgetSpan(
alignment: .middle,
child: Icon(
MdiIcons.unfoldMoreHorizontal,
size: 14,
color: theme.colorScheme.secondary,
),
),
],
),
),
),
onSelected: (value) {
plPlayerController.setShader(value);
if (context.mounted) {
(context as Element).markNeedsBuild();
}
},
itemBuilder: (context) => SuperResolutionType.values
.map(
(item) => PopupMenuItem(
value: item,
child: Text(item.title),
),
)
.toList(),
),
),
],
title: const Text('超分辨率'),
value: () {
final value = plPlayerController.superResolutionType.value;
return (value, value.label);
},
itemBuilder: (_) => enumItemBuilder<SuperResolutionType>(
SuperResolutionType.values,
),
onSelected: (value, setState) {
plPlayerController.setShader(value);
setState();
},
descPosType: .title,
),
if (!isFileSource)
ListTile(