mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 04:57:23 +00:00
add a setting for original image
This commit is contained in:
@@ -318,6 +318,10 @@ class _IllustPageState extends State<IllustPage> {
|
||||
}
|
||||
Widget image;
|
||||
|
||||
var imageUrl = appdata.settings["showOriginalImage"]
|
||||
? widget.illust.images[index].original
|
||||
: widget.illust.images[index].large;
|
||||
|
||||
if (!widget.illust.isUgoira) {
|
||||
image = SizedBox(
|
||||
width: imageWidth,
|
||||
@@ -327,8 +331,7 @@ class _IllustPageState extends State<IllustPage> {
|
||||
child: Image(
|
||||
key: ValueKey(index),
|
||||
image: downloadFile == null
|
||||
? CachedImageProvider(widget.illust.images[index].large)
|
||||
as ImageProvider
|
||||
? CachedImageProvider(imageUrl) as ImageProvider
|
||||
: FileImage(downloadFile) as ImageProvider,
|
||||
width: imageWidth,
|
||||
fit: BoxFit.cover,
|
||||
|
@@ -252,6 +252,16 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
context.to(() => const ShortcutsSettings());
|
||||
},
|
||||
)),
|
||||
buildItem(
|
||||
title: "Display the original image on the details page".tl,
|
||||
action: ToggleSwitch(
|
||||
checked: appdata.settings['showOriginalImage'],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
appdata.settings['showOriginalImage'] = value;
|
||||
});
|
||||
appdata.writeData();
|
||||
})),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user