Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
35b09283 by wurstsalat at 2025-08-01T22:16:35+02:00
fix: Messages: Align LTR/RTL messages correctly if the global direction differs

Fixes #12383

- - - - -


1 changed file:

- gajim/gtk/conversation/rows/message.py


Changes:

=====================================
gajim/gtk/conversation/rows/message.py
=====================================
@@ -239,12 +239,13 @@ def _redraw_content(self) -> None:
             self._set_error(error_text)
 
     def _set_text_direction(self, text: str) -> None:
-        if is_rtl_text(text):
+        global_rtl = self._message_widget.get_direction() == 
Gtk.TextDirection.RTL
+        message_rtl = is_rtl_text(text)
+
+        if (global_rtl and not message_rtl) or (not global_rtl and 
message_rtl):
+            # LTR message in an RTL environment (align to the left) or
+            # RTL message in an LTR environment (align to the right)
             self._bottom_box.set_halign(Gtk.Align.END)
-            self._message_widget.set_direction(Gtk.TextDirection.RTL)
-        else:
-            self._bottom_box.set_halign(Gtk.Align.FILL)
-            self._message_widget.set_direction(Gtk.TextDirection.LTR)
 
     @property
     def _muc_context(self) -> str | None:



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

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