https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • f

    full-journalist-82607

    05/01/2023, 4:53 PM
    Yeah, but then I understand why . In code, it's logic to use layoutName as it's a String and layout would be a layout. it's confusing because I had forgotten about layoutName and I'm sure I've used it before haha
  • f

    full-journalist-82607

    05/01/2023, 4:54 PM
    that would be great in fact it was the css I needed ( and then I tried in xml and got more confused)
  • b

    bright-gpu-74537

    05/01/2023, 4:56 PM
    its actually not like that (as much as i would like to say that), it was that layout was supposed to (originally) be a totally different thing that simply isnt needed (it seems), and if it is / was, is almost certainly not going to work anyway (with the current dead impl)
  • b

    bright-gpu-74537

    05/01/2023, 4:57 PM
    yeah, this feels like a bug, layout should almost certainly work in the css looking at the code you linked, so something else is going on there (likely unrelated to the layoutName stuff)
  • r

    refined-greece-48002

    05/01/2023, 7:59 PM
    https://www.haxeui.org/builder/?29daf2c2 It looks like adding a button to a Property removes its label (repro'd on html5 and heaps)
  • p

    purple-businessperson-14467

    05/01/2023, 10:16 PM
    Thanks, that works http://haxeui.org/builder/?0d76d56d
  • e

    early-butcher-76809

    05/01/2023, 11:09 PM
    I'd like to add a component (composed of components) to a scroll view then scroll it to the top of the new component but I struggle to do it. The layout computation is not done when the child component is added (it's done in the update loop, later), so I can't do it right after the ``addComponent``. The scroll view doesn't seem to fire events afterwards. The child component does, though, but its MOVE or RESIZE events are called multiple times and the relevant values (contentHeight, y or height of the component...) of the scroll box keep changing (I guess it's because of the layout computation of each child inside the added component). Here, MOVE is called 5 times on the added child component and scrollView.contentHeight is final after the 5th call. Unregistering the event is not really possible since I don't know when the final value will be given to me. Is there maybe another (simpler) way to do it than trying to bind an event to the a layout and scroll ? ^^'

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

  • e

    early-butcher-76809

    05/01/2023, 11:38 PM
    Oh, there is a Box named contents in ScrollView that gets children actually added to. That's why I didn't have events firing from my ScrollView ! Now, I do get RESIZE events from that contents and it almost works ! Since the values keep changing before it's settled correctly (namely the child's y and the scroll's contentHeight), it changes my scroll value multiple times and it's ugly :(
  • e

    early-butcher-76809

    05/01/2023, 11:59 PM
    I guess I could have a solution if I make this work but it will be a nasty one, hiding the 1 frame scroll bump behind the fade in ^^'
  • a

    ambitious-knife-25690

    05/01/2023, 11:59 PM
    I'm not sure what you mean by "it is done in the update loop so i can't do it right after the `addComponent`"
  • a

    ambitious-knife-25690

    05/02/2023, 12:00 AM
    could you move the addcomponent part to the update loop?
  • e

    early-butcher-76809

    05/02/2023, 12:01 AM
    The layout computation (call to validateComponentLayout) is done async in the update loop, over time, not directly in the addComponent
  • e

    early-butcher-76809

    05/02/2023, 12:02 AM
    So you don't have you computed value right after you call to addComponent. Which can suck ^^
  • a

    ambitious-knife-25690

    05/02/2023, 12:02 AM
    okay, that is fine, but in the update loop why not just call
    component.scrollbox.vscrollPos = 0
    when you're done
  • e

    early-butcher-76809

    05/02/2023, 12:03 AM
    It's not my code calling validateComponentLayout async, it's HaxeUI code
  • e

    early-butcher-76809

    05/02/2023, 12:03 AM
    I just do my stuff (click a button, add a child to the scroll view) but since I don't have computed layout values, I must find a way to scroll my scroll view somehow
  • a

    ambitious-knife-25690

    05/02/2023, 12:04 AM
    > the top of the new component but I struggle to do it. ohhh You don't want it at component index
    0
  • a

    ambitious-knife-25690

    05/02/2023, 12:04 AM
    you want it to be at component index
    just added
  • e

    early-butcher-76809

    05/02/2023, 12:04 AM
    Ha ha no, I don't want it at 0, it would be easier otherwise :D
  • e

    early-butcher-76809

    05/02/2023, 12:04 AM
    Yep, last child
  • a

    ambitious-knife-25690

    05/02/2023, 12:04 AM
    ahhh hmmmm
  • a

    ambitious-knife-25690

    05/02/2023, 12:25 AM
  • a

    ambitious-knife-25690

    05/02/2023, 12:25 AM
    can i offer you a hacky but elegant solution instead? 😄
  • e

    early-butcher-76809

    05/02/2023, 12:28 AM
    Ha ha nice one. Although, there is one thing I realize I haven't mentioned : my added components can be bigger than the height of the scroll view. I want the scroll offset to be at their beginning, not the end. Think of a dialogue box for a game. After a few paragraphs, you get a choice. When you click the choice, you get new paragraphs. The scroll offset then starts at the beginning of the new text, which can be longer than the height of the scroll view.
  • a

    ambitious-knife-25690

    05/02/2023, 12:29 AM
    well, the hack does take that into account
  • a

    ambitious-knife-25690

    05/02/2023, 12:29 AM
    i take the current fullscrollview length and add a very very large number to it
  • e

    early-butcher-76809

    05/02/2023, 12:30 AM
    It means, with a 250px button, the scroll is then at the very end :

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

  • a

    ambitious-knife-25690

    05/02/2023, 12:30 AM
    but i guess it wouldn't work for dialog because it would scroll to the bottom of the text not to the start of the element...
  • e

    early-butcher-76809

    05/02/2023, 12:30 AM
    That's right
  • a

    ambitious-knife-25690

    05/02/2023, 12:31 AM
    it works on my end, maybe browser or plugin issue?
1...165516561657...1687Latest