@dasdom How do you make sure you're feeling is correct?
You're entitled to hating to work with SwiftUI and having all kinds of feelings, of course. And I sympathize!
But I'd really be interested in "productivity", as in: producing something, some output.
@ctietze @dasdom My benchmark is https://twitter.com/teilweise/status/1295700159184154624
10 min.
@teilweise @dasdom Love that, I'll play with this
@teilweise @dasdom Tried and failed :D
@ctietze @dasdom LOL. Thanks a lot for trying! I really appreciate that.
In 2020 my guess was you could do it with GeometryReader, today, I think you could use a custom Layout. But that’s kind of cheating: If you have do the layout manually, autosizing is just as good.
Simple workaround Apple came up with: Arrange the buttons vertically. ;-)
@ctietze @teilweise @dasdom Interesting. My first expectation was that this is just two HStacks in a VStack ? Is the problem in SwiftUI specifying what should resist compression the longest?
@uliwitness @ctietze @dasdom Can you get three buttons the same size but not bigger than the biggest one with HStack?
Then resizing should modify the spacer between first and second button. If this is no longer possible, the buttons should start to shrink (but maintain equal size). Only when a button reaches its minimum size, the equal size is given up for that button.
Window size (min. and max.) is constrained by content (only horizontal resize allowed).
Must work with all translations.
@teilweise Ah, all of them. The system standard dialog had the right ones at the same size, and left one a different one. So a nested stack view would probably have fixed that bit. But yeah, if you want them all the same size, that's really difficult due to the extra spacing.
@uliwitness I think the standard dialog just had a min size for all buttons. Probably the size “Cancel“ needs in most languages. At least the screenshots I could Google make me think that was the rule.
Are these rules too wired? I think it’s a small example with rules that you totally might want to have in a more complex UI. Sure, it’s only a detail, just allow the buttons to be any size (or vertical) …
I USED to say: “Am Mac ist auch nicht alles Gold, was glänzt – ABER WENIGSTENS GLÄNZT ER!”
@teilweise @dasdom @uliwitness Spoiler: I recorded everything on video. I think it could be fun to try this in public as a challenge. I know Uli streams sometimes, maybe that's something for you as well? :)
Is this what you want, more or less? Took ~6 mins
@notkoalas @ctietze @dasdom That’s about where I gave up.
• Button texts must not truncate (but shorter buttons must maintain equal size as long as possible).
• The window size must be constrained to valid sizes.
• No non-standard whitespace around the content or between elements.
• Missing headline.
• Icon alignment and size.
Once all of this works, restart it in pseudo language. Then translate it to a language where the left button is the shortest.
@notkoalas @teilweise @dasdom Close! The leftmost button should never shrink.
And vertical sizing should actually be a function/effect of the text taking more vertical space.
Will update the README