Improve image loading

This commit is contained in:
2025-01-16 17:51:43 +08:00
parent 5d1d62e157
commit c640e6bfbf
13 changed files with 144 additions and 35 deletions

View File

@@ -131,9 +131,10 @@ class _ReaderSettingsState extends State<ReaderSettings> {
"On the image browsing page, you can quickly collect images by sliding horizontally or vertically according to your reading mode"
.tl,
).toSliver(),
_PopupWindowSetting(
_CallbackSetting(
title: "Custom Image Processing".tl,
builder: () => _CustomImageProcessing(),
callback: () => context.to(() => _CustomImageProcessing()),
actionTitle: "Edit".tl,
).toSliver(),
],
);
@@ -163,10 +164,25 @@ class __CustomImageProcessingState extends State<_CustomImageProcessing> {
super.dispose();
}
int resetKey = 0;
@override
Widget build(BuildContext context) {
return PopUpWidgetScaffold(
title: "Custom Image Processing".tl,
return Scaffold(
appBar: Appbar(
title: Text("Custom Image Processing".tl),
actions: [
TextButton(
onPressed: () {
current = defaultCustomImageProcessing;
appdata.settings['customImageProcessing'] = current;
resetKey++;
setState(() {});
},
child: Text("Reset".tl),
)
],
),
body: Column(
children: [
_SwitchSetting(
@@ -182,6 +198,7 @@ class __CustomImageProcessingState extends State<_CustomImageProcessing> {
),
child: SizedBox.expand(
child: CodeEditor(
key: ValueKey(resetKey),
initialValue: appdata.settings['customImageProcessing'],
onChanged: (value) {
current = value;