Daniel Brötzmann pushed to branch gtk4 at gajim / gajim
Commits:
6511e208 by wurstsalat at 2024-11-14T22:03:01+01:00
refactor: GCTooltip: Unify hats icon
- - - - -
e72662db by wurstsalat at 2024-11-14T22:11:39+01:00
refactor: Improve styles for ContactTooltip and GCTooltip
- - - - -
3 changed files:
- gajim/data/gui/contact_tooltip.ui
- gajim/data/gui/groupchat_roster_tooltip.ui
- gajim/gtk/tooltips.py
Changes:
=====================================
gajim/data/gui/contact_tooltip.ui
=====================================
@@ -3,7 +3,6 @@
<requires lib="gtk" version="4.0"/>
<object class="GtkGrid" id="tooltip_grid">
<property name="halign">start</property>
- <property name="row-spacing">3</property>
<property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="jid">
@@ -129,5 +128,8 @@
</layout>
</object>
</child>
+ <style>
+ <class name="p-3"/>
+ </style>
</object>
</interface>
=====================================
gajim/data/gui/groupchat_roster_tooltip.ui
=====================================
@@ -2,7 +2,7 @@
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkGrid" id="tooltip_grid">
- <property name="column-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkImage" id="avatar">
<property name="valign">start</property>
@@ -93,6 +93,7 @@
<property name="halign">start</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <property name="margin-top">6</property>
<child>
<placeholder/>
</child>
@@ -120,5 +121,8 @@
<child>
<placeholder/>
</child>
+ <style>
+ <class name="p-3"/>
+ </style>
</object>
</interface>
=====================================
gajim/gtk/tooltips.py
=====================================
@@ -104,14 +104,21 @@ def _populate_grid(self, contact: GroupchatParticipant)
-> None:
for hat in contact.hats.get_hats()[:5]:
# Limit to 5 hats
- hat_badge = Gtk.Label(
- label=f"🎓 {GLib.markup_escape_text(hat.title)}",
+ hat_badge = Gtk.Box(spacing=6)
+ hat_badge.add_css_class("badge")
+ hat_badge.add_css_class("hat-badge")
+
+ hat_badge_icon =
Gtk.Image.new_from_icon_name("feather-tag-symbolic")
+ hat_badge.append(hat_badge_icon)
+
+ hat_badge_label = Gtk.Label(
+ label=GLib.markup_escape_text(hat.title),
ellipsize=Pango.EllipsizeMode.END,
max_width_chars=20,
)
- hat_badge.set_halign(Gtk.Align.START)
- hat_badge.add_css_class("badge")
- hat_badge.add_css_class("hat-badge")
+ hat_badge_label.set_halign(Gtk.Align.START)
+ hat_badge.append(hat_badge_label)
+
self._ui.hats_box.append(hat_badge)
self._ui.hats_box.set_visible(True)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1187c9f7c0906d60bb26e29517dd6410b63d1935...e72662db65164217cbd3911bb21aacc17589c770
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1187c9f7c0906d60bb26e29517dd6410b63d1935...e72662db65164217cbd3911bb21aacc17589c770
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]