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

Advanced PaneGrid usage #525

Closed
lerouxrgd opened this issue Sep 14, 2020 · 3 comments
Closed

Advanced PaneGrid usage #525

lerouxrgd opened this issue Sep 14, 2020 · 3 comments
Labels
question Further information is requested

Comments

@lerouxrgd
Copy link

I am trying to put Image and Scrollable content (basically controls to modify the image) in different panes of a PaneGrid.

It looks like scrollable have infinite length when put in panes. And it also looks like images are not scaled automatically to use maximum available space (which is the case if they are not in a Pane). Besides, it feels like rendering an image in a Pane is more expensive (higher CPU usage and longer rendering time).

Is it a bad idea to put Image and Scrollable content in PaneGrid ? Or are there some parameters to tune for things to go smoothly ?

@hecrj
Copy link
Member

hecrj commented Sep 14, 2020

The pane_grid example uses a Scrollable inside a PaneGrid.

I am not sure I understand the issue you are having. What are you trying to do exactly? Could you share an SSCCE?

Is it a bad idea to put Image and Scrollable content in PaneGrid ? Or are there some parameters to tune for things to go smoothly ?

Scrollable is currently quite expensive. It creates a new rendering layer, which incorrectly invalidates text cache (see #41). I am hoping to have a fix for this soon!

@hecrj hecrj added the question Further information is requested label Sep 14, 2020
@lerouxrgd
Copy link
Author

What are you trying to do exactly?

So the idea is to have a GUI with 2 parts, one to display an image, and the other with controls to pixelize the image. You can actually check the current code here. On master the 2 parts are just two cells of a column and it works smoothly. On panes branch I try to put the 2 parts in two panes. The reason I want to use panes is to be able to resize and switch layout (row/column) of the 2 parts.

Could you share an SSCCE?

So I made this SSCCE. It displays the Rust logo when you choose its resolution through a radio control.

When using 144px, the whole pane space won't be completely filled (as it would happen if I hadn't use panes but simply columns, because Image tries to resize its content to fill up all the available space, if I understood it correctly). It also feels like rendering the 1024px image is slow (again, compared to an Image used in a regular container) even though it is not wrapped in a Scrollable here.

Finally, the pane with the Radio can be scrolled down infinitely and there is no slider displayed.

@lerouxrgd
Copy link
Author

Ok I realized that at least for the Scrollable controls I just have to not wrap them in a Container to get the expected behavior.

@hecrj hecrj closed this as completed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants