humbleui

fricze 2024-07-11T14:03:42.658449Z

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?

fricze 2024-07-12T14:52:05.005249Z

next question: is there some way to add underline to paragraphs?

fricze 2024-07-12T14:52:18.394599Z

or does it require recreating paragraphs in some new, more flexible version?

Niki 2024-07-12T16:17:52.181639Z

Paragraphs are not in yet, not really. There’s an entire stack for supporting them in Skia but I haven’t tapped it yet

👍 1
Niki 2024-07-12T16:18:09.567889Z

Certainly on a roadmap, once I clean up the basics

👍 1
Niki 2024-07-11T15:16:46.714419Z

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)

Niki 2024-07-11T16:28:19.172949Z

actually, try this https://github.com/HumbleUI/HumbleUI/commit/d2934245e035e79d848ce1dd7f4b6cb8ba3878b0

🔥 2
Niki 2024-07-11T16:28:36.702809Z

I think it makes sense having this in a standard library

Niki 2024-07-11T16:28:53.785219Z

I might change how are themes handled later

fricze 2024-07-12T06:41:49.435429Z

thank you so much 😄

fricze 2024-07-12T06:42:00.235349Z

you solved few of my issues at once with this code 😄

fricze 2024-07-12T06:42:10.151239Z

awesome

fricze 2024-07-13T16:07:15.003319Z

I see, thanks