How to control the initial window size? #159
-
I cannot quite figure out if setting the initial window size is currently a missing feature, or if I just fail to figure it out. One thing I tried is to control the window size via the let inner_size = Dynamic::new(Size::new(UPx::new(1000), UPx::new(800)));
build_some_widget()
.into_window()
.inner_size(inner_size)
.run(); But it looks like this does not respect the initial value (which may be a bit problematic for Setting the widget to a fixed size also doesn't quite result in the desired behavior, because then the window cannot be resized at all, i.e., it is not just affecting the initial size. I also noticed a slight visual artifact of fixing the widget size like that: Initially, for a very short moment, the window is actually drawn in the default 800x600 size and only shortly after it gets resized to the fixed size. The size jump looks a bit weird. Another related use case would be to control whether the window gets initialized into "maximized" state. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry for not noticing this for so long! I let my Github notices pile up with a couple of hectic weeks, and I somehow missed this in the list. This is a little bit of a pain point of me trying to embrace both dynamics and This means that for now, setting the window's attributes' |
Beta Was this translation helpful? Give feedback.
I've addressed this specific attribute with this change: 60c7ef8
Since
WIndowAttributes::inner_size
is an option, we can fill it in when it isNone
with the value contained in the dynamic. I'm leaving the issue I created open so that I can still handle this better in the long-term.