Hello there 👋🏻 I’m having very nice time with humble, I was trying to make links that change text color on hover and unfortunately I cannot. with-context works for setting text color, but when I’m using hoverable to change this color, based on :hovered state, nothing happens. Is there, currently, some way to make it work?
next question: is there some way to add underline to paragraphs?
or does it require recreating paragraphs in some new, more flexible version?
Paragraphs are not in yet, not really. There’s an entire stack for supporting them in Skia but I haven’t tapped it yet
Certainly on a roadmap, once I clean up the basics
Current way is like this:
(ui/defcomp link [on-click text]
[ui/center
[ui/with-cursor {:cursor :pointing-hand}
[ui/clickable {:on-click (fn [_event] (on-click))}
(fn [state]
[ui/label
{:paint (cond
(:pressed state) (paint/fill 0xFFFF0000)
(:hovered state) (paint/fill 0xFF551A8B)
:else (paint/fill 0xFF0000EE))}
text])]]])
hoverable works the same but doesn’t have :pressed state (state is a set, that’s why the checks are like that)actually, try this https://github.com/HumbleUI/HumbleUI/commit/d2934245e035e79d848ce1dd7f4b6cb8ba3878b0
I think it makes sense having this in a standard library
I might change how are themes handled later
thank you so much 😄
you solved few of my issues at once with this code 😄
awesome
I see, thanks