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