swift-cross-ui icon indicating copy to clipboard operation
swift-cross-ui copied to clipboard

Give windows a sensible default size

Open stackotter opened this issue 10 months ago • 4 comments

At the moment windows default to the smallest possible size (under most backends). It'd be much nicer if they defaulted to some more sensible dimension such as 800x400 or something.

Any suggestions for default dimensions/aspect ratios?

stackotter avatar Apr 09 '24 14:04 stackotter

Would it be practical to have the window size be calculated based on the initially visible views?

ichordev avatar Jun 13 '24 13:06 ichordev

At the moment it kinda works like that (although that's just a result of not specifying a default window size, and letting each UI framework do whatever it wants). The main issue is that if you have a window that only contains Text("Hello, World!") then you get a tiny little window that is as small as it can possibly be (which in my eyes isn't a great default, although maybe other people think otherwise).

Using the 'natural size' of the window's initial contents in conjunction with some other factors such as a minimum default size etc could work well, although it's tricky to compute the size of an initial view in general (since it's backend specific and often UI frameworks adjust the sizes of views based on available space, making a feedback loop if you use content size to adjust the window size).

stackotter avatar Jun 16 '24 04:06 stackotter

To be honest just have fixed window size the above could work

jj10133 avatar Jul 12 '24 20:07 jj10133

Yeah, probably quite a sensible default at least

stackotter avatar Jul 18 '24 14:07 stackotter