humbleui

Niki 2024-07-02T18:47:53.209549Z

Thinking of this format to document components, wdyt?

💯 1
👏 1
😍 8
michael zhou 2024-07-03T11:43:49.567979Z

Looks great! 👍

Dominik Engelhardt 2024-07-02T19:20:56.407559Z

This approach seems very logical! While there's merit in having documentation that doesn't need the application to run, I understand that creating docs in this manner is more enjoyable than managing an external document. At this point in the project, I would focus on the ease of writing documentation rather than the ease of consuming it, so this is excellent. Additionally, these docs serve as a kind of integration test for the components used, which is another benefit. It's great to see some progress and the vdom branch finally merged!

Niki 2024-07-02T21:30:56.182059Z

Thank you! It all started from the need for integration tests, but I figured it could serve two purposes

Niki 2024-07-02T21:31:16.544599Z

Plus it will always stay true to the real code

😍 1
michael zhou 2024-07-02T02:39:40.226499Z

hello! If I want to create a label or rectangle in humbleui, specifying coordinates and dimensions xywh, for example [label :x x :y y :w w :h h], how can I do it concisely, thanks

Niki 2024-07-02T11:02:15.336479Z

Width and height:

[ui/width {:width w}
 [ui/height {:height h}
  [ui/label ...]]]

Niki 2024-07-02T11:03:37.427039Z

For x and y, you can try:

[ui/padding {:left x, :top y}
 [ui/width {:width w}
  [ui/height {:height h}
   [ui/label ...]]]]

michael zhou 2024-07-02T13:08:16.128169Z

thanks. I tried but find rect fill-color cover all canvas. (ui/defcomp x-label [text x y w h] [ui/rect {:paint (paint/fill 0xFFB2D7FE)} [ui/padding {:left x :top y} [ui/size {:width w :height h} [ui/label text] ]]])

michael zhou 2024-07-02T13:08:28.675849Z

Dont know why.

michael zhou 2024-07-02T13:09:18.960079Z

I just want rect paint fill color to cover the label. Thanks.

Niki 2024-07-02T13:59:03.025269Z

wrap it around label

Niki 2024-07-02T13:59:50.916479Z

Or size even

michael zhou 2024-07-02T14:41:12.839649Z

Still not what I expected, after adjusting like this the fill-color covers one row.

michael zhou 2024-07-02T14:41:51.266649Z

I want to place labels with background color anywhere on the canvas.

Niki 2024-07-02T14:42:42.214659Z

Show me what are you getting

michael zhou 2024-07-02T14:51:50.423499Z

Niki 2024-07-02T14:52:56.669509Z

Wrap it into [ui/halign {:position 0} [ui/valign {:position 0} ...]]

Niki 2024-07-02T14:53:38.020369Z

Components stretch by default, if you want them to have their minimal size you have to put them into align

michael zhou 2024-07-02T15:02:22.680199Z

@tonsky It's working. Thanks.

🎉 1
Niki 2024-07-02T15:05:09.087539Z

I’ll write a good tutorial one day about all this, but before that, feel free to ping me here

michael zhou 2024-07-02T15:39:17.396529Z

Thanks. HumbleUI is really awesome.