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


Commits:
248e4c70 by Philipp Hörist at 2025-12-10T20:50:59+01:00
cfix: MessageActionBox: Simplify resize after vadjustment change

- - - - -


1 changed file:

- gajim/gtk/message_actions_box.py


Changes:

=====================================
gajim/gtk/message_actions_box.py
=====================================
@@ -229,22 +229,13 @@ def _on_input_scrolled_changed(self, adj: Gtk.Adjustment) 
-> None:
             > scrolled.get_max_content_height() - 2 * 
self._vscrollbar_min_height
         )
 
-        self._start_queue_resize_if_needed()
-
-    def _start_queue_resize_if_needed(self) -> None:
-        if self._wait_queue_resize is None and self._contact is not None:
-            self._wait_queue_resize = GLib.timeout_add(50, 
self._queue_resize_if_needed)
-
-    def _queue_resize_if_needed(self) -> bool:
-        if (
-            self._ui.input_scrolled.get_height()
-            >= self._ui.input_scrolled.get_size_request()[1]
-        ):
-            self._wait_queue_resize = None
-            return GLib.SOURCE_REMOVE
+        if self._contact is not None and self._wait_queue_resize is None:
+            self._wait_queue_resize = GLib.timeout_add(100, self._queue_resize)
 
+    def _queue_resize(self) -> bool:
+        self._wait_queue_resize = None
         self._ui.input_scrolled.queue_resize()
-        return GLib.SOURCE_CONTINUE
+        return GLib.SOURCE_REMOVE
 
     def _on_view_realize(self, _view: Gtk.TextView) -> None:
         min_size, _ = self._ui.input_scrolled.get_preferred_size()



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

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