diff --git a/lib/pages/setting/models/style_settings.dart b/lib/pages/setting/models/style_settings.dart index b1778f12c..ea41a96b1 100644 --- a/lib/pages/setting/models/style_settings.dart +++ b/lib/pages/setting/models/style_settings.dart @@ -18,14 +18,12 @@ import 'package:PiliPlus/models/common/theme/theme_type.dart'; import 'package:PiliPlus/pages/main/controller.dart'; import 'package:PiliPlus/pages/mine/controller.dart'; import 'package:PiliPlus/pages/setting/models/model.dart'; -import 'package:PiliPlus/pages/setting/pages/color_select.dart'; import 'package:PiliPlus/pages/setting/slide_color_picker.dart'; import 'package:PiliPlus/pages/setting/widgets/dual_slide_dialog.dart'; import 'package:PiliPlus/pages/setting/widgets/multi_select_dialog.dart'; import 'package:PiliPlus/pages/setting/widgets/select_dialog.dart'; import 'package:PiliPlus/pages/setting/widgets/slide_dialog.dart'; import 'package:PiliPlus/plugin/pl_player/utils/fullscreen.dart'; -import 'package:PiliPlus/utils/extension/get_ext.dart'; import 'package:PiliPlus/utils/extension/num_ext.dart'; import 'package:PiliPlus/utils/extension/theme_ext.dart'; import 'package:PiliPlus/utils/global_data.dart'; @@ -562,7 +560,6 @@ List get styleSettings => [ Get.find().themeType.value = result; } catch (_) {} GStorage.setting.put(SettingBoxKey.themeMode, result.index); - Get.putOrFind(ColorSelectController.new).themeType.value = result; Get.changeThemeMode(result.toThemeMode); setState(); } @@ -692,20 +689,17 @@ List get styleSettings => [ ), NormalModel( onTap: (context, setState) async { - final result = await Get.toNamed('/fontSizeSetting'); - if (result != null) { - Get.putOrFind(ColorSelectController.new).currentTextScale.value = - result; + final res = await Get.toNamed('/fontSizeSetting'); + if (res != null) { + setState(); } }, title: '字体大小', leading: const Icon(Icons.format_size_outlined), - getSubtitle: () => - Get.putOrFind(ColorSelectController.new).currentTextScale.value == 1.0 - ? '默认' - : Get.putOrFind( - ColorSelectController.new, - ).currentTextScale.value.toString(), + getSubtitle: () { + final scale = Pref.defaultTextScale; + return scale == 1.0 ? '默认' : scale.toString(); + }, ), NormalModel( onTap: (context, setState) => Get.toNamed( diff --git a/lib/pages/setting/pages/color_select.dart b/lib/pages/setting/pages/color_select.dart index 5ef1f07ab..1f69165d1 100644 --- a/lib/pages/setting/pages/color_select.dart +++ b/lib/pages/setting/pages/color_select.dart @@ -38,7 +38,7 @@ class Item { } class _ColorSelectPageState extends State { - final ctr = Get.put(ColorSelectController()); + final ctr = Get.put(_ColorSelectController()); FlexSchemeVariant _dynamicSchemeVariant = Pref.schemeVariant; @override @@ -270,10 +270,9 @@ class _ColorSelectPageState extends State { } } -class ColorSelectController extends GetxController { +class _ColorSelectController extends GetxController { final RxBool dynamicColor = Pref.dynamicColor.obs; final RxInt currentColor = Pref.customColor.obs; - final RxDouble currentTextScale = Pref.defaultTextScale.obs; final Rx themeType = Pref.themeType.obs; Box get setting => GStorage.setting; diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index b35962e4e..c43933c91 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -1500,84 +1500,85 @@ class _VideoDetailPageVState extends State }).toList(), ); - return Container( - height: 45, + return DecoratedBox( decoration: BoxDecoration( border: Border( bottom: BorderSide( - width: 1, color: themeData.dividerColor.withValues(alpha: 0.1), ), ), ), - child: Row( - children: [ - if (tabs.isEmpty) - const Spacer() - else + child: SizedBox( + height: 45, + child: Row( + children: [ + if (tabs.isEmpty) + const Spacer() + else + Flexible( + flex: tabs.length == 3 ? 2 : 1, + child: tabBar(), + ), Flexible( - flex: tabs.length == 3 ? 2 : 1, - child: tabBar(), - ), - Flexible( - flex: 1, - child: Center( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SizedBox( - height: 32, - child: TextButton( - style: const ButtonStyle( - padding: WidgetStatePropertyAll(EdgeInsets.zero), - ), - onPressed: videoDetailController.showShootDanmakuSheet, - child: Text( - '发弹幕', - style: TextStyle( - fontSize: 12, - color: themeData.colorScheme.onSurfaceVariant, + flex: 1, + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SizedBox( + height: 32, + child: TextButton( + style: const ButtonStyle( + padding: WidgetStatePropertyAll(EdgeInsets.zero), + ), + onPressed: videoDetailController.showShootDanmakuSheet, + child: Text( + '发弹幕', + style: TextStyle( + fontSize: 12, + color: themeData.colorScheme.onSurfaceVariant, + ), ), ), ), - ), - SizedBox( - width: 38, - height: 38, - child: Obx( - () { - final ctr = videoDetailController.plPlayerController; - final enableShowDanmaku = ctr.enableShowDanmaku.value; - return IconButton( - onPressed: () { - final newVal = !enableShowDanmaku; - ctr.enableShowDanmaku.value = newVal; - if (!ctr.tempPlayerConf) { - GStorage.setting.put( - SettingBoxKey.enableShowDanmaku, - newVal, - ); - } - }, - icon: Icon( - size: 22, - enableShowDanmaku - ? CustomIcons.dm_on - : CustomIcons.dm_off, - color: enableShowDanmaku - ? themeData.colorScheme.secondary - : themeData.colorScheme.outline, - ), - ); - }, + SizedBox( + width: 38, + height: 38, + child: Obx( + () { + final ctr = videoDetailController.plPlayerController; + final enableShowDanmaku = ctr.enableShowDanmaku.value; + return IconButton( + onPressed: () { + final newVal = !enableShowDanmaku; + ctr.enableShowDanmaku.value = newVal; + if (!ctr.tempPlayerConf) { + GStorage.setting.put( + SettingBoxKey.enableShowDanmaku, + newVal, + ); + } + }, + icon: Icon( + size: 22, + enableShowDanmaku + ? CustomIcons.dm_on + : CustomIcons.dm_off, + color: enableShowDanmaku + ? themeData.colorScheme.secondary + : themeData.colorScheme.outline, + ), + ); + }, + ), ), - ), - const SizedBox(width: 14), - ], + const SizedBox(width: 14), + ], + ), ), ), - ), - ], + ], + ), ), ); }