mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: show text scale subtitle
This commit is contained in:
@@ -149,6 +149,7 @@ class ColorSelectController extends GetxController {
|
||||
RxInt type = 0.obs;
|
||||
late final List<Map<String, dynamic>> colorThemes;
|
||||
RxInt currentColor = 0.obs;
|
||||
RxDouble currentTextScale = 1.0.obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -159,6 +160,8 @@ class ColorSelectController extends GetxController {
|
||||
type.value = dynamicColor.value ? 0 : 1;
|
||||
currentColor.value =
|
||||
setting.get(SettingBoxKey.customColor, defaultValue: 0);
|
||||
currentTextScale.value =
|
||||
setting.get(SettingBoxKey.defaultTextScale, defaultValue: 1.0);
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
setFontSize() {
|
||||
setting.put(SettingBoxKey.defaultTextScale, currentSize);
|
||||
Get.forceAppUpdate();
|
||||
Get.back();
|
||||
Get.back(result: currentSize);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -67,7 +67,7 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
.colorScheme
|
||||
.primary
|
||||
.withOpacity(0.3))),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
@@ -359,9 +359,20 @@ class _StyleSettingState extends State<StyleSetting> {
|
||||
),
|
||||
ListTile(
|
||||
dense: false,
|
||||
onTap: () => Get.toNamed('/fontSizeSetting'),
|
||||
onTap: () async {
|
||||
dynamic result = await Get.toNamed('/fontSizeSetting');
|
||||
if (result != null) {
|
||||
colorSelectController.currentTextScale.value = result;
|
||||
}
|
||||
},
|
||||
title: Text('字体大小', style: titleStyle),
|
||||
leading: const Icon(Icons.format_size_outlined),
|
||||
subtitle: Obx(() => Text(
|
||||
colorSelectController.currentTextScale.value == 1.0
|
||||
? '默认'
|
||||
: colorSelectController.currentTextScale.value.toString(),
|
||||
style: subTitleStyle,
|
||||
)),
|
||||
),
|
||||
ListTile(
|
||||
dense: false,
|
||||
|
||||
Reference in New Issue
Block a user