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

When the user clicks a thumbnail image, show the full-size image in an image viewer widget #341

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

aaravlu
Copy link
Contributor

@aaravlu aaravlu commented Jan 22, 2025

issue #327
There is no loading spinner currently.
It's a bit much so that I think you can conduct a round of reviews. :)
Screencast from 2025-01-22 12-37-15.webm

@aaravlu aaravlu changed the title Fix327 When the user clicks a thumbnail image, show the full-size image in an image viewer widget Jan 22, 2025
@aaravlu aaravlu requested a review from kevinaboos January 22, 2025 04:38
@alanpoon
Copy link
Contributor

There is no close button for Image previewer. Only the button to close the entire program.
https://github.com/user-attachments/assets/d0a2db15-1ee4-42a7-8756-46d5fd031408

@alanpoon alanpoon added the waiting-on-author This issue is waiting on the original author for a response label Jan 23, 2025
@aaravlu
Copy link
Contributor Author

aaravlu commented Jan 23, 2025

There is no close button for Image previewer. Only the button to close the entire program. https://github.com/user-attachments/assets/d0a2db15-1ee4-42a7-8756-46d5fd031408

Yeah, many bugs currently, all the widgetsabout image viewer, I set absolutly position, so maybe you cannot see the button.

Now it's better, but still some bugs :(
Screencast from 2025-01-23 11-49-27.webm

@aaravlu
Copy link
Contributor Author

aaravlu commented Jan 24, 2025

  • We cannot set height or width Fit for <ImageViewerModal>, because it doesn't know how long or wide the image is, it is waiting for the image's actual length or width, but the image has not been fetched yet.

width: 1600, height: 900

  • A widget wrapped by <Modal> cannot handle_actions it self when the <Modal> is closed. I do this in app.rs so it can be avoided.

match action.downcast_ref() {

  • After a large size image being fetched and filled to image viewer, we cannot see the image, I guess it cousts too large amout of time fetching the image to "forget" to redraw, so that it cannot be seen.

  • Fetching image to image viewer can block ui threads, I have no idea for this currently.

We can keep this pr open and I shall put my energies elsewhere issues, IMHO

@aaravlu aaravlu added blocked-on-makepad Blocked on a Makepad bug or missing Makepad feature and removed waiting-on-author This issue is waiting on the original author for a response labels Jan 24, 2025
@kevinaboos
Copy link
Member

  • We cannot set height or width Fit for <ImageViewerModal>, because it doesn't know how long or wide the image is, it is waiting for the image's actual length or width, but the image has not been fetched yet.

Right, but in general, the Matrix SDK can provide image metadata including dimensions, so you can use that as a placeholder until you download the entire image. Even if you don't know the size of the image, you can just show the thumbnail image in the ImageViewer widget until the full-size image has been fully-fetched, and then you will know the size of the full image.

Regardless, it should not matter what the image's size is. The ImageViewer should be full-screen (width: Fill, height: Fill), and the Image fit mode can be set to fit: Biggest (or Smallest, based on your desired choice).

  • A widget wrapped by <Modal> cannot handle_actions it self when the <Modal> is closed. I do this in app.rs so it can be avoided.

You're correct, the Modal widget doesn't. We can modify it, but in general, the Modal widget has lots of issues right now. Don't use the Modal widget; you can copy my LoadingPane widget instead.

  • After a large size image being fetched and filled to image viewer, we cannot see the image, I guess it cousts too large amout of time fetching the image to "forget" to redraw, so that it cannot be seen.

I don't understand what this means, sorry.

  • Fetching image to image viewer can block ui threads, I have no idea for this currently.

Yes, of course, you'll have to do it on a background thread/task. We already have the infrastructure for this.

In summary, it sounds like you're a bit stuck on this, which is totally fine. Thanks for submitting your work thus far; in the future, I (or others) can help you complete the ImageViewer widget.

@kevinaboos kevinaboos added help wanted Looking for help from anyone! and removed blocked-on-makepad Blocked on a Makepad bug or missing Makepad feature labels Jan 24, 2025
@kevinaboos kevinaboos added the blocked Blocked on another issue or missing feature label Jan 24, 2025
@kevinaboos
Copy link
Member

Marking this as blocked since it's not actually blocked on any missing feature from Makepad.

@aaravlu
Copy link
Contributor Author

aaravlu commented Jan 24, 2025

In summary, it sounds like you're a bit stuck on this, which is totally fine. Thanks for submitting your work thus far; in the future, I (or others) can help you complete the ImageViewer widget.

Got all, thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on another issue or missing feature help wanted Looking for help from anyone!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants