Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated image viewer restructure #1645

Merged
merged 3 commits into from
Dec 28, 2024
Merged

Conversation

CTalvio
Copy link
Collaborator

@CTalvio CTalvio commented Dec 18, 2024

Pull Request Description

I used a stack to make the image viewer widget the size of the screen, which seems to be the only way to avoid the bugs the current viewer is suffering from.

Hence the scaffold and appbar get ditched in favor of simple containers for any buttons we need, stacked atop the image.

I found that layoutInsets can be used to have the initial size of the image limited to the are that is not covered by buttons.

Not in the earlier PR, here I also added prevention for images to be saved twice.

Issue Being Fixed

The inability of the image to fill the screen in some circumstances, causing it to get cut off for seemingly no reason. This was especially prevalent in landscape aspect ratios.

Screenshots / Recordings

Kooha-2024-05-03-22-54-31.mp4

Best illustrated when built into a resizable desktop app. Images always start off not covering the top and bottom bar, but when zoomed utilize the full screen.

Checklist

  • Did you use localized strings (and added appropriate descriptions) where applicable?

@CTalvio
Copy link
Collaborator Author

CTalvio commented Dec 18, 2024

Also tested in emulator. Correctly respects system top/bottom bars, but now always uses the full screen to display zoomed images.

Worth considering: Automatically go into the "fullscreen" mode on zoom.

@CTalvio
Copy link
Collaborator Author

CTalvio commented Dec 19, 2024

Added: Dynamic fullscreen behaviour.

Above 1.2 zoom, the viewer will automatically enter the full screen mode, hiding all UI elements, now also including system.

Full screen is exited below 1.2 zoom, or if the user taps the screen without changing the zoom level.

Screen_recording_20241219_143045.mp4

@micahmo
Copy link
Member

micahmo commented Dec 19, 2024

Wow that's really cool!

@micahmo
Copy link
Member

micahmo commented Dec 23, 2024

Hey I noticed one more problem with the current version of Thunder that this PR fixes. When you open an image, the nav bar changes to white, but the status bar stays black, meaning you can't see it. In the last demo video, I can see the status bar properly changes to white! I hope this can be reviewed and merged soon. 😊

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I haven't tested it yet but I'll go ahead and merge this in first. Thanks again for updating the changes with the latest develop branch!

@hjiangsu hjiangsu merged commit eed071c into thunder-app:develop Dec 28, 2024
1 check passed
@micahmo
Copy link
Member

micahmo commented Jan 1, 2025

Hey @CTalvio, just wanted to say I'm really enjoying this change, especially the auto fullscreen!

I noticed a (probably rare) edge case where Thunder can get stuck in fullscreen mode when you zoom in and then use the back gesture. I think we probably just need to detect when the image viewer is closing and reset the mode if necessary. It's not a big deal (the fullscreen will fix itself next time you open an image) and I'm not asking you to fix, just pointing it out!

Here's a demo of the problem and the fix.

qemu-system-x86_64_LyujmGJ6T3.mp4

@CTalvio
Copy link
Collaborator Author

CTalvio commented Jan 1, 2025

I might be able to look at it. My year is off to a great start (sarcasm) and I won't be able to work for about a week, so I'll have time.

Feel free to beat me to the punch tho.

@micahmo
Copy link
Member

micahmo commented Jan 2, 2025

I won't be able to work for about a week

Oh man I'm sorry to hear that! :(

I had a few minutes to take a look and I think I fixed it reliably, but let me know what you think.

#1653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants