Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-30 11:13:19 +08:00
parent d6e6e52df2
commit 207ad2753c
4 changed files with 76 additions and 65 deletions

View File

@@ -1826,6 +1826,11 @@ class HeaderControlState extends State<HeaderControl>
} else {
title = const Spacer();
}
const btnWidth = 40.0;
const btnHeight = 34.0;
const btnStyle = ButtonStyle(padding: WidgetStatePropertyAll(.zero));
return AppBar(
elevation: 0,
scrolledUnderElevation: 0,
@@ -1841,10 +1846,11 @@ class HeaderControlState extends State<HeaderControl>
Row(
children: [
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '返回',
style: btnStyle,
icon: const Icon(
FontAwesomeIcons.arrowLeft,
size: 15,
@@ -1870,10 +1876,11 @@ class HeaderControlState extends State<HeaderControl>
if (!plPlayerController.isDesktopPip &&
(!isFullScreen || !isPortrait))
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '返回主页',
style: btnStyle,
icon: const Icon(
FontAwesomeIcons.house,
size: 15,
@@ -1894,13 +1901,11 @@ class HeaderControlState extends State<HeaderControl>
Obx(() {
final isAlwaysOnTop = plPlayerController.isAlwaysOnTop.value;
return SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
style: btnStyle,
tooltip: '${isAlwaysOnTop ? '取消' : ''}置顶',
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
onPressed: () =>
plPlayerController.setAlwaysOnTop(!isAlwaysOnTop),
icon: isAlwaysOnTop
@@ -1921,13 +1926,11 @@ class HeaderControlState extends State<HeaderControl>
if (!isFSOrPip) ...[
if (videoDetailCtr.isUgc)
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '听音频',
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: videoDetailCtr.toAudioPage,
icon: const Icon(
Icons.headphones_outlined,
@@ -1937,13 +1940,11 @@ class HeaderControlState extends State<HeaderControl>
),
),
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '投屏',
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: videoDetailCtr.onCast,
icon: const Icon(
Icons.cast,
@@ -1955,13 +1956,11 @@ class HeaderControlState extends State<HeaderControl>
],
if (plPlayerController.enableSponsorBlock)
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '提交片段',
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: () => videoDetailCtr.onBlock(context),
icon: const Stack(
clipBehavior: Clip.none,
@@ -1984,13 +1983,11 @@ class HeaderControlState extends State<HeaderControl>
Obx(
() => videoDetailCtr.segmentProgressList.isNotEmpty
? SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '片段信息',
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: () =>
videoDetailCtr.showSBDetail(context),
icon: const Icon(
@@ -2005,13 +2002,11 @@ class HeaderControlState extends State<HeaderControl>
],
if (isFullScreen || PlatformUtils.isDesktop) ...[
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '发弹幕',
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: videoDetailCtr.showShootDanmakuSheet,
icon: const Icon(
Icons.comment_outlined,
@@ -2021,17 +2016,15 @@ class HeaderControlState extends State<HeaderControl>
),
),
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: Obx(
() {
final enableShowDanmaku =
plPlayerController.enableShowDanmaku.value;
return IconButton(
tooltip: "${enableShowDanmaku ? '关闭' : '开启'}弹幕",
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: () {
final newVal = !enableShowDanmaku;
plPlayerController.enableShowDanmaku.value = newVal;
@@ -2058,16 +2051,28 @@ class HeaderControlState extends State<HeaderControl>
),
),
],
SizedBox(
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '弹幕设置',
style: btnStyle,
onPressed: showSetDanmaku,
icon: const Icon(
size: 20,
CustomIcons.dm_settings,
color: Colors.white,
),
),
),
if (Platform.isAndroid ||
(PlatformUtils.isDesktop && !isFullScreen))
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: '画中画',
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: () async {
if (PlatformUtils.isDesktop) {
plPlayerController.toggleDesktopPip();
@@ -2161,13 +2166,11 @@ class HeaderControlState extends State<HeaderControl>
),
),
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: IconButton(
tooltip: "更多设置",
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
),
style: btnStyle,
onPressed: showSettingSheet,
icon: const Icon(
Icons.more_vert_outlined,
@@ -2184,8 +2187,8 @@ class HeaderControlState extends State<HeaderControl>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: Obx(
() => ActionItem(
expand: false,
@@ -2214,8 +2217,8 @@ class HeaderControlState extends State<HeaderControl>
),
if (introController case final UgcIntroController ugc)
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: Obx(
() => ActionItem(
expand: false,
@@ -2233,8 +2236,8 @@ class HeaderControlState extends State<HeaderControl>
),
),
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: Obx(
() => ActionItem(
expand: false,
@@ -2251,8 +2254,8 @@ class HeaderControlState extends State<HeaderControl>
),
),
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: Obx(
() => ActionItem(
expand: false,
@@ -2273,8 +2276,8 @@ class HeaderControlState extends State<HeaderControl>
),
),
SizedBox(
width: 42,
height: 34,
width: btnWidth,
height: btnHeight,
child: ActionItem(
expand: false,
icon: const Icon(