Philipp Hörist pushed to branch master at gajim / gajim


Commits:
c3fa2a84 by nicoco at 2025-10-24T16:50:03+00:00
imprv: GroupChat: Support color for hats

- - - - -


1 changed file:

- gajim/gtk/tooltips.py


Changes:

=====================================
gajim/gtk/tooltips.py
=====================================
@@ -99,6 +99,16 @@ def _populate_grid(self, contact: GroupchatParticipant) -> 
None:
                 hat_badge = Gtk.Box(spacing=6, halign=Gtk.Align.START)
                 hat_badge.add_css_class("badge")
                 hat_badge.add_css_class("badge-hat")
+                if hat.hue is not None:
+                    css_provider = Gtk.CssProvider()
+                    css_provider.load_from_string(
+                        ".badge-hat "
+                        f"{{background-color: hsl({hat.hue * 360}, 100%, 
25%);}}"
+                    )
+                    context = hat_badge.get_style_context()
+                    context.add_provider(
+                        css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
+                    )
 
                 hat_badge_icon = 
Gtk.Image.new_from_icon_name("lucide-tag-symbolic")
                 hat_badge.append(hat_badge_icon)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/c3fa2a84c67a33670d6dd34323e8f724de50d0e1

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/c3fa2a84c67a33670d6dd34323e8f724de50d0e1
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to