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

@@ -8,12 +8,14 @@ Widget avatars({
}) { }) {
const gap = 6.0; const gap = 6.0;
const size = 22.0; const size = 22.0;
const padding = 0.8;
const offset = size - gap; const offset = size - gap;
const imgSize = size - 2 * padding;
if (users.length == 1) { if (users.length == 1) {
return NetworkImgLayer( return NetworkImgLayer(
src: users.first.face, src: users.first.face,
width: size, width: imgSize,
height: size, height: imgSize,
type: .avatar, type: .avatar,
); );
} else { } else {
@@ -36,11 +38,11 @@ Widget avatars({
child: DecoratedBox( child: DecoratedBox(
decoration: decoration, decoration: decoration,
child: Padding( child: Padding(
padding: const .all(.8), padding: const .all(padding),
child: NetworkImgLayer( child: NetworkImgLayer(
src: e.$2.face, src: e.$2.face,
width: size - .8, width: imgSize,
height: size - .8, height: imgSize,
type: .avatar, type: .avatar,
), ),
), ),

View File

@@ -31,7 +31,9 @@ Future<TimeOfDay?> showTimePicker({
assert(debugCheckHasMaterialLocalizations(context)); assert(debugCheckHasMaterialLocalizations(context));
final Widget dialog = DialogTheme( final Widget dialog = DialogTheme(
data: const DialogThemeData(constraints: BoxConstraints(minWidth: 280.0)), data: DialogTheme.of(
context,
).copyWith(constraints: const BoxConstraints(minWidth: 280.0)),
child: TimePickerDialog( child: TimePickerDialog(
initialTime: initialTime, initialTime: initialTime,
initialEntryMode: initialEntryMode, initialEntryMode: initialEntryMode,

View File

@@ -761,6 +761,10 @@ class LoginPageController extends GetxController
), ),
), ),
TextButton( TextButton(
style: TextButton.styleFrom(
visualDensity: .compact,
tapTargetSize: .shrinkWrap,
),
onPressed: () { onPressed: () {
quickSelect = !quickSelect; quickSelect = !quickSelect;
(context as Element).markNeedsBuild(); (context as Element).markNeedsBuild();

View File

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