diff --git a/lib/common/widgets/avatars.dart b/lib/common/widgets/avatars.dart index 7444a0206..933060b27 100644 --- a/lib/common/widgets/avatars.dart +++ b/lib/common/widgets/avatars.dart @@ -8,12 +8,14 @@ Widget avatars({ }) { const gap = 6.0; const size = 22.0; + const padding = 0.8; const offset = size - gap; + const imgSize = size - 2 * padding; if (users.length == 1) { return NetworkImgLayer( src: users.first.face, - width: size, - height: size, + width: imgSize, + height: imgSize, type: .avatar, ); } else { @@ -36,11 +38,11 @@ Widget avatars({ child: DecoratedBox( decoration: decoration, child: Padding( - padding: const .all(.8), + padding: const .all(padding), child: NetworkImgLayer( src: e.$2.face, - width: size - .8, - height: size - .8, + width: imgSize, + height: imgSize, type: .avatar, ), ), diff --git a/lib/common/widgets/flutter/time_picker.dart b/lib/common/widgets/flutter/time_picker.dart index 84fdbec22..a72bdaacc 100644 --- a/lib/common/widgets/flutter/time_picker.dart +++ b/lib/common/widgets/flutter/time_picker.dart @@ -31,7 +31,9 @@ Future showTimePicker({ assert(debugCheckHasMaterialLocalizations(context)); 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( initialTime: initialTime, initialEntryMode: initialEntryMode, diff --git a/lib/pages/login/controller.dart b/lib/pages/login/controller.dart index 08f4dc5da..68414eab3 100644 --- a/lib/pages/login/controller.dart +++ b/lib/pages/login/controller.dart @@ -761,6 +761,10 @@ class LoginPageController extends GetxController ), ), TextButton( + style: TextButton.styleFrom( + visualDensity: .compact, + tapTargetSize: .shrinkWrap, + ), onPressed: () { quickSelect = !quickSelect; (context as Element).markNeedsBuild(); diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index 077b77d70..e602c2bd7 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -1826,6 +1826,11 @@ class HeaderControlState extends State } 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 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 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 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 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 ), ), 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 ], 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 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 ], 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 ), ), 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 ), ), ], + 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 ), ), 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 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 ), 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 ), ), SizedBox( - width: 42, - height: 34, + width: btnWidth, + height: btnHeight, child: Obx( () => ActionItem( expand: false, @@ -2251,8 +2254,8 @@ class HeaderControlState extends State ), ), SizedBox( - width: 42, - height: 34, + width: btnWidth, + height: btnHeight, child: Obx( () => ActionItem( expand: false, @@ -2273,8 +2276,8 @@ class HeaderControlState extends State ), ), SizedBox( - width: 42, - height: 34, + width: btnWidth, + height: btnHeight, child: ActionItem( expand: false, icon: const Icon(