https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • (this way you dont have to do the 100 / 3 calc, which if you add another item becomes 100 / 4, etc - better to let haxeui do the calc)
    b

    bright-gpu-74537

    04/06/2023, 5:30 AM
    (this way you dont have to do the 100 / 3 calc, which if you add another item becomes 100 / 4, etc - better to let haxeui do the calc)
  • Thanks! I think those both will work
    h

    helpful-boots-41914

    04/06/2023, 5:38 AM
    Thanks! I think those both will work
  • New issue - I'm seeing some wrong behavior. Note here: http://haxeui.org/builder/?8ce3800f You can see in the builder that everything is incorrectly crunched together. I don't know what version of haxeui it is or what the target it is, but that's wrong. However, at least the VBox is working in this version. On the other hand there is Kha, the version I'm using, and that same code outputs this:
    h

    helpful-boots-41914

    04/06/2023, 6:29 PM
    New issue - I'm seeing some wrong behavior. Note here: http://haxeui.org/builder/?8ce3800f You can see in the builder that everything is incorrectly crunched together. I don't know what version of haxeui it is or what the target it is, but that's wrong. However, at least the VBox is working in this version. On the other hand there is Kha, the version I'm using, and that same code outputs this:

    https://cdn.discordapp.com/attachments/565569107701923852/1093603455463071814/image.png▾

  • So both are wrong but the kha version's vbox just doesn't work . . . However, if I remove the vbox that would contain the "list" it actually displays - mostly - correctly
    h

    helpful-boots-41914

    04/06/2023, 6:30 PM
    So both are wrong but the kha version's vbox just doesn't work . . . However, if I remove the vbox that would contain the "list" it actually displays - mostly - correctly
  • yeah... where _is_ the join button... :/
    b

    bright-gpu-74537

    04/06/2023, 6:46 PM
    yeah... where is the join button... :/
  • ok, you've pushed it out of the view
    b

    bright-gpu-74537

    04/06/2023, 6:46 PM
    ok, you've pushed it out of the view
  • ```xml <hbox width="100%" height="40px"> <label text="Johnny's room" width="25%" /> <label text="Johnny's name" width="25%" /> <label text="2/10" width="25%"/> <spacer width="100%" /> <button text="join" /> </hbox> ```
    b

    bright-gpu-74537

    04/06/2023, 6:47 PM
    Copy code
    xml
                <hbox width="100%" height="40px">
                    <label text="Johnny's room" width="25%" />
                    <label text="Johnny's name" width="25%" />
                    <label text="2/10" width="25%"/>
                    <spacer width="100%" />
                    <button text="join" />                
                </hbox>
  • all the other components are taking up 175% of the view
    b

    bright-gpu-74537

    04/06/2023, 6:47 PM
    all the other components are taking up 175% of the view
  • Ahh I was thinking haxeui would be smarter than me and smoosh it back in haha. So maybe this is an example where I do need to be more careful then?
    h

    helpful-boots-41914

    04/06/2023, 6:48 PM
    Ahh I was thinking haxeui would be smarter than me and smoosh it back in haha. So maybe this is an example where I do need to be more careful then?
  • yeah, 100% is special, all other %'s arent... so haxeui will see this as "25% of the view * 3", plus (a full 100% - since no other 100%'s), then the button
    b

    bright-gpu-74537

    04/06/2023, 6:49 PM
    yeah, 100% is special, all other %'s arent... so haxeui will see this as "25% of the view * 3", plus (a full 100% - since no other 100%'s), then the button
  • theres probably room for improvement here, but, tbh, im not actually sure what 25%/25%/25%/100% is _supposed_ to mean
    b

    bright-gpu-74537

    04/06/2023, 6:50 PM
    theres probably room for improvement here, but, tbh, im not actually sure what 25%/25%/25%/100% is supposed to mean
  • Well the intuition I had was was that the spacer being 100% would separate the left from the right . . . The left would have 3 evenly spaced elements while the right side would take up the "rest"
    h

    helpful-boots-41914

    04/06/2023, 6:52 PM
    Well the intuition I had was was that the spacer being 100% would separate the left from the right . . . The left would have 3 evenly spaced elements while the right side would take up the "rest"
  • i think i see what you mean, like, the 3 25's would be 75% of the view, then the remaining 100% would be "the rest", so `totalwidth - 75% - "join button width"`
    b

    bright-gpu-74537

    04/06/2023, 6:53 PM
    i think i see what you mean, like, the 3 25's would be 75% of the view, then the remaining 100% would be "the rest", so
    totalwidth - 75% - "join button width"
  • Right, the spacer taking up "100%" would equate to what you just wrote
    h

    helpful-boots-41914

    04/06/2023, 6:56 PM
    Right, the spacer taking up "100%" would equate to what you just wrote
  • Seems like it might not be a common use case though
    h

    helpful-boots-41914

    04/06/2023, 6:56 PM
    Seems like it might not be a common use case though
  • To want that behavior that is
    h

    helpful-boots-41914

    04/06/2023, 6:56 PM
    To want that behavior that is
  • it certainly not how it works atm, ill have a think, the problem is getting into all types of mess because things arent fully equal to 100% (is totally valid)
    b

    bright-gpu-74537

    04/06/2023, 6:57 PM
    it certainly not how it works atm, ill have a think, the problem is getting into all types of mess because things arent fully equal to 100% (is totally valid)
  • btw, if you wan the same effect (and arguably simpler), i would do this:
    b

    bright-gpu-74537

    04/06/2023, 6:57 PM
    btw, if you wan the same effect (and arguably simpler), i would do this:
  • http://haxeui.org/builder/?f5c14b8b
    b

    bright-gpu-74537

    04/06/2023, 6:58 PM
    http://haxeui.org/builder/?f5c14b8b
  • you could also do this: http://haxeui.org/builder/?d6228813 (if you dont want to deal with divisions of %'s, ie, make things 100%)
    b

    bright-gpu-74537

    04/06/2023, 7:00 PM
    you could also do this: http://haxeui.org/builder/?d6228813 (if you dont want to deal with divisions of %'s, ie, make things 100%)
  • so here the first hbox will be 100%, but there is another 100%, so actually it will get assigned 50% of the "usable width" (usable width is the width after any subtractions)
    b

    bright-gpu-74537

    04/06/2023, 7:01 PM
    so here the first hbox will be 100%, but there is another 100%, so actually it will get assigned 50% of the "usable width" (usable width is the width after any subtractions)
  • Ahh that'll do it for now! More comments incoming
    h

    helpful-boots-41914

    04/06/2023, 7:01 PM
    Ahh that'll do it for now! More comments incoming
  • Q1 - why doesn't HBox have a property called "class"? How do we style it with a custom class then? Q2 - This may need to be a bug report. If you're using the Kha version and use `border-radius: Npx` the border disappears completely. I am using the version with the new shaders. I noticed this isn't the behavior with the builder.
    h

    helpful-boots-41914

    04/06/2023, 7:10 PM
    Q1 - why doesn't HBox have a property called "class"? How do we style it with a custom class then? Q2 - This may need to be a bug report. If you're using the Kha version and use
    border-radius: Npx
    the border disappears completely. I am using the version with the new shaders. I noticed this isn't the behavior with the builder.
  • Q2: does feel like a bug
    b

    bright-gpu-74537

    04/06/2023, 7:12 PM
    Q2: does feel like a bug
  • Ahh I knew this once. My bad! And okay gotcha, I'll post a bug report. Thanks!
    h

    helpful-boots-41914

    04/06/2023, 7:12 PM
    Ahh I knew this once. My bad! And okay gotcha, I'll post a bug report. Thanks!
  • kha: `<box width="200" height="75" style="background: yellow blue;border:5px solid red;border-radius: 18px;" />`
    b

    bright-gpu-74537

    04/06/2023, 7:14 PM
    kha:
    <box width="200" height="75" style="background: yellow blue;border:5px solid red;border-radius: 18px;" />
  • b

    bright-gpu-74537

    04/06/2023, 7:15 PM

    https://cdn.discordapp.com/attachments/565569107701923852/1093614874002731098/image.png▾

  • you not getting that?
    b

    bright-gpu-74537

    04/06/2023, 7:15 PM
    you not getting that?
  • oh
    b

    bright-gpu-74537

    04/06/2023, 7:16 PM
    oh
  • `<box width="200" height="75" style="border:5px solid red;border-radius: 18px;" />` = nothing
    b

    bright-gpu-74537

    04/06/2023, 7:16 PM
    <box width="200" height="75" style="border:5px solid red;border-radius: 18px;" />
    = nothing
1...161916201621...1687Latest