• what if changing some text means the item changes size

    Yes, that would be a pain, however I imagine for the vast majority of apps you probably don't want things to start moving around on the screen when text changes? It's almost a benefit if stuff stays in the same place unless it is explicitly updated.

    Vector font width

    Yes, this does make a lot of sense. I was avoiding it because I assumed it would be a slow iterative thing, but @NebbishHacker has a really neat trick there to do it quick.

    It does make me wonder whether if no font is specified, it almost makes sense to choose the font automatically? Like use Vector for >20px, and then 6x8:2, 6x8, 4x6 depending on the width available?

    I guess you don't want the font changing each time but if the font selection were done during 'update' it wouldn't be a huge problem.

    I'm guessing that only one element can be set to {fillx:true} in a row or column

    No, you can have more than one in layout. The way it's implemented it'd be trivial to make fillx/filly an integer though. That would make a lot of sense.

    My example does use lazy rendering!

    Sorry, I didn't notice that! I just saw the UI 'tree' being recreated each call and assumed it wasn't :)

    Thanks for the PR - I'm a bit busy at the moment but I'll try and have a proper play with it at some point. I'll post some comments on the PR itself though

  • I imagine for the vast majority of apps you probably don't want things to start moving around on the screen when text changes?

    Having things move around on screen when the text changes was pretty much the entire original motivation behind my 'trui' library 🙂

    I think for most apps the question is how well they can predict the maximum size of each element - if each piece of text has a predictable maximum size they can calculate the layout once and leave it fixed, but if there's a chance of the text overflowing its original bounds that risks breaking the layout. This can especially be an issue due to localization, if the localized strings end up being longer than the app developer was imagining.

    No, you can have more than one in layout.

    I stand corrected!

About