-
Notifications
You must be signed in to change notification settings - Fork 41
Show clicked-on images in a full-screen view with zoom/pan #565
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
Conversation
91bf416 to
440bde3
Compare
|
Intention of adding an image magnifier and the ability to pan image. The image's image_scale, image_pan will always be set to default in draw_walk. Hence unable to dynamically scale and pan image. |
1b7875f to
ddd04b9
Compare
@alanpoon I just checked with Rik, and this line should not be present in the Image widget. It's some errant code left over from dealing with animations in a strange way. You can submit a PR to makepad that removes that line, and then continue with this issue here. |
|
Sure, the makepad PR is here: makepad/makepad#788 |
kevinaboos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Alan, nice work here.
My main comment is that we should decouple the ImageViewer widget from the RoomScreen. It doesn't need to know anything about the RoomScreen except for being able to access the RoomScreen's MediaCache instance (technically even that is not required, see Aarav's PR for an example of just passing the image data directly from the media fetch background task to the ImageViewer via an action).
Also, Aarav and I had a lot of discussions about using actions to communicate with the ImageViewer widget in PR#443. I think you can combine your approach (of storing images in the RoomScreen's MediaCache) with the action-based design from #443 (in which you emit an action including the image data/status instead of directly accessing the widget and calling a function on it). Actions are more idiomatic and also allow easy communication from any context, both in a background task and in a RoomScreen TimelineUpdate handler.
|
hi @alanpoon, when you have a moment can you resolve the conflicts and address my minor feedback here? I'd love to get this PR merged in soon since it's a really nice addition/feature to have. |
Sure |
…essary cargo.lock changes, rightwrap image_name_and_size_view
kevinaboos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more comments, mostly nit-picky (sorry...).
One general comment is that I'd prefer names that are unique and more descriptive. They're easier to grep for and easier to understand from the perspective of someone reading our code for the first time. For example:
Configshould beZoomConfigorImageViewerZoomConfig.MetaDatashould beImageViewerMetadata.- etc
aside from that, everything looks good.
Co-authored-by: Kevin Boos <1139460+kevinaboos@users.noreply.github.com>
kevinaboos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, thanks for all the revisions! Much appreciated.



Fixes #327

in replacement of #443
Waiting for this PR to be merged: makepad/makepad#788.