Daniel Brötzmann pushed to branch timezone-hint at gajim / gajim
Commits:
61587ee7 by cal0pteryx at 2026-04-09T21:18:16+02:00
cfix: Timezone hint: Display inline with ChatstateHint and hide on chat state
change
- - - - -
4 changed files:
- gajim/data/gui/message_actions_box.ui
- gajim/gtk/builder.pyi
- gajim/gtk/message_actions_box.py
- gajim/gtk/timezone_hint.py
Changes:
=====================================
gajim/data/gui/message_actions_box.ui
=====================================
@@ -5,16 +5,8 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkBox" id="timezone_hint_box">
- <property name="orientation">vertical</property>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkBox" id="chat_state_box">
- <property name="orientation">vertical</property>
+ <object class="GtkBox" id="hint_box">
+ <property name="spacing">12</property>
<child>
<placeholder/>
</child>
=====================================
gajim/gtk/builder.pyi
=====================================
@@ -417,8 +417,7 @@ class ManageSoundsBuilder(Builder):
class MessageActionsBoxBuilder(Builder):
box: Gtk.Box
- timezone_hint_box: Gtk.Box
- chat_state_box: Gtk.Box
+ hint_box: Gtk.Box
link_previews_box: Gtk.Box
reply_box: Gtk.Box
state_box: Gtk.Box
=====================================
gajim/gtk/message_actions_box.py
=====================================
@@ -81,10 +81,10 @@ def __init__(self) -> None:
self._ui.edit_box_image.set_size_request(AvatarSize.CHAT, -1)
self._timezone_hint = TimezoneHint()
- self._ui.timezone_hint_box.append(self._timezone_hint)
+ self._ui.hint_box.append(self._timezone_hint)
self._chat_state_indicator = ChatStateIndicator()
- self._ui.chat_state_box.append(self._chat_state_indicator)
+ self._ui.hint_box.append(self._chat_state_indicator)
# For message replies
self._reply_box = ReplyBox()
=====================================
gajim/gtk/timezone_hint.py
=====================================
@@ -49,6 +49,7 @@ def switch_contact(self, contact: types.ChatContactT) -> None:
return
self._contact = contact
+ self._contact.connect("chatstate-update", self._on_chatstate_update)
client = app.get_client(contact.account)
vcard = client.get_module("VCard4").request_vcard(
@@ -59,6 +60,12 @@ def switch_contact(self, contact: types.ChatContactT) ->
None:
if vcard is not None:
self._process_vcard(vcard)
+ def _on_chatstate_update(
+ self, _contact: types.ChatContactT, _signal_name: str
+ ) -> None:
+ # Hide as soon as there is a chat state update (user is present)
+ self.set_visible(False)
+
def _on_vcard_received(self, jid: JID, vcard: VCard) -> None:
self._process_vcard(vcard)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/61587ee7ed17a8025b4e2ccff643b20b342871b5
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/61587ee7ed17a8025b4e2ccff643b20b342871b5
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]