mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-26 13:25:49 +08:00
@@ -397,7 +397,7 @@ List<SettingsModel> get styleSettings => [
|
||||
context: context,
|
||||
title: '图片质量',
|
||||
initValue: Pref.picQuality,
|
||||
callback: (picQuality) async {
|
||||
onChanged: (picQuality) async {
|
||||
GlobalData().imgQuality = picQuality;
|
||||
await GStorage.setting.put(SettingBoxKey.defaultPicQa, picQuality);
|
||||
setState();
|
||||
@@ -422,7 +422,7 @@ List<SettingsModel> get styleSettings => [
|
||||
context: context,
|
||||
title: '查看大图质量',
|
||||
initValue: Pref.previewQ,
|
||||
callback: (picQuality) async {
|
||||
onChanged: (picQuality) async {
|
||||
await GStorage.setting.put(SettingBoxKey.previewQuality, picQuality);
|
||||
setState();
|
||||
},
|
||||
@@ -450,7 +450,7 @@ List<SettingsModel> get styleSettings => [
|
||||
title: const Text('Color Picker'),
|
||||
content: SlideColorPicker(
|
||||
color: reduceLuxColor ?? Colors.white,
|
||||
callback: (Color? color) {
|
||||
onChanged: (Color? color) {
|
||||
if (color != null && color != reduceLuxColor) {
|
||||
if (color == Colors.white) {
|
||||
NetworkImgLayer.reduceLuxColor = null;
|
||||
@@ -729,7 +729,7 @@ void _showQualityDialog({
|
||||
required BuildContext context,
|
||||
required String title,
|
||||
required int initValue,
|
||||
required ValueChanged<int> callback,
|
||||
required ValueChanged<int> onChanged,
|
||||
}) {
|
||||
showDialog<double>(
|
||||
context: context,
|
||||
@@ -745,7 +745,7 @@ void _showQualityDialog({
|
||||
).then((result) {
|
||||
if (result != null) {
|
||||
SmartDialog.showToast('设置成功');
|
||||
callback(result.toInt());
|
||||
onChanged(result.toInt());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ class SlideColorPicker extends StatefulWidget {
|
||||
const SlideColorPicker({
|
||||
super.key,
|
||||
required this.color,
|
||||
required this.callback,
|
||||
required this.onChanged,
|
||||
this.showResetBtn = false,
|
||||
});
|
||||
|
||||
final Color color;
|
||||
final Function(Color? color) callback;
|
||||
final Function(Color? color) onChanged;
|
||||
final bool showResetBtn;
|
||||
|
||||
@override
|
||||
@@ -150,7 +150,7 @@ class _SlideColorPickerState extends State<SlideColorPicker> {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
widget.callback(null);
|
||||
widget.onChanged(null);
|
||||
},
|
||||
child: const Text('重置'),
|
||||
),
|
||||
@@ -168,7 +168,7 @@ class _SlideColorPickerState extends State<SlideColorPicker> {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
widget.callback(DmUtils.decimalToColor(_rgb));
|
||||
widget.onChanged(DmUtils.decimalToColor(_rgb));
|
||||
},
|
||||
child: const Text('确定'),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user