You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently don't know when the window is getting resized, so I can't make adaptive decisions about how the content is being displayed unless I keep a background task continually "manually" checking. Example:
This way, I can specify a function to be called only when the window has changed.
Describe alternatives you've considered
Keep doing it manually;
For the exemplified use case, it would be better if I was able to tell the image to adopt the window's width (or its box's width), so I wouldn't have to do any resizing.
Additional context
No response
The text was updated successfully, but these errors were encountered:
This wouldn't be an on_change signal - it would be an on_resize signal. A change signal would describe the fact that the content of the widget had changed.
However, I should caution that if you're using Toga as intended, an on_resize signal should generally not be needed. if you're hard-coding sizes, or responding specifically to window size changes, you're missing the point of Toga's style-based layout language. In the specific case you've described, the issue is that there's no style directive to resize the image to fill the box. That is the real underlying issue here.
That said - it wouldn't be too difficult to add an on_resize handler, as the signal is already being generated to manage window size changes. All we would be doing is adding a user callback once that size change had been applied. Since the implementation should be relatively straightforward, and could be useful for situations like mobile phones changing rotation (which may require a layout change), I guess adding an on_resize handler would make sense.
freakboy3742
changed the title
Add "on_change" to MainWindow
Add "on_resize" to MainWindow
Dec 30, 2023
What is the problem or limitation you are having?
I currently don't know when the window is getting resized, so I can't make adaptive decisions about how the content is being displayed unless I keep a background task continually "manually" checking. Example:
Describe the solution you'd like
An
on_change
method in MainWindow.This way, I can specify a function to be called only when the window has changed.
Describe alternatives you've considered
Additional context
No response
The text was updated successfully, but these errors were encountered: