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


Commits:
43c2c80c by Philipp Hörist at 2024-11-10T00:42:06+01:00
fix: GroupchatRoster: Fix status label and tooltip

- - - - -


2 changed files:

- gajim/data/gui/groupchat_contact_view_item.ui
- gajim/gtk/groupchat_roster.py


Changes:

=====================================
gajim/data/gui/groupchat_contact_view_item.ui
=====================================
@@ -3,13 +3,10 @@
   <requires lib="gtk" version="4.0"/>
   <template class="GroupchatContactViewItem" parent="GtkGrid">
     <property name="column-spacing">12</property>
-<!--     <style>
-      <class name="start-chat-row"/>
-    </style> -->
+    <property name="has-tooltip">1</property>
     <child>
       <object class="GtkImage" id="_avatar">
         <property name="pixel-size">32</property>
-        <property name="has-tooltip">1</property>
         <layout>
           <property name="column">0</property>
           <property name="row">0</property>


=====================================
gajim/gtk/groupchat_roster.py
=====================================
@@ -458,11 +458,15 @@ def __init__(self) -> None:
         self._contact: GroupchatParticipant | None = None
 
         self._tooltip = GCTooltip()
-        self._connect(self._avatar, "query-tooltip", 
self._query_avatar_tooltip)
+        self._connect(self, "query-tooltip", self._query_tooltip)
 
         self._popover_menu = GajimPopover(None)
         self.attach(self._popover_menu, 4, 0, 1, 1)
 
+        self._connect(
+            self._status_message_label, "notify::label", self._on_status_change
+        )
+
         gesture_secondary_click = Gtk.GestureClick(
             button=Gdk.BUTTON_SECONDARY, 
propagation_phase=Gtk.PropagationPhase.BUBBLE
         )
@@ -511,6 +515,9 @@ def do_unroot(self) -> None:
         del self._tooltip
         app.check_finalize(self)
 
+    def _on_status_change(self, label: Gtk.Label, *args: Any) -> None:
+        label.set_visible(bool(label.get_label()))
+
     def _update_avatar(self, contact: GroupchatParticipant, *args: Any) -> 
None:
         paintable = contact.get_avatar(AvatarSize.ROSTER, 
app.window.get_scale_factor())
         self._avatar.set_from_paintable(paintable)
@@ -544,7 +551,7 @@ def _popup_menu(
 
         return Gdk.EVENT_STOP
 
-    def _query_avatar_tooltip(
+    def _query_tooltip(
         self,
         list_view: GroupchatContactListView,
         x: int,



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

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/43c2c80ccadfbf374acdc31ed638b4fd07e96b2c
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