diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-04-21 21:35:27 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-04-21 21:35:56 +0300 |
commit | b10e13cc21d904b518454d72a19068d8980915ad (patch) | |
tree | db2c585bac7a2aa8330f72a56b910949f403de51 | |
parent | 99dad790f42d6b191621042a29c7b592d5ce5c4d (diff) |
fix: Make manually changing the pinned chat sort order work again
-rw-r--r-- | gajim/gtk/chat_list.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gajim/gtk/chat_list.py b/gajim/gtk/chat_list.py index 914a7197f..23046225d 100644 --- a/gajim/gtk/chat_list.py +++ b/gajim/gtk/chat_list.py @@ -72,6 +72,7 @@ class ChatList(Gtk.ListBox, EventHelper): self._set_placeholder() self._mouseover: bool = False + self._pinned_order_change = False self.connect('enter-notify-event', self._on_mouse_focus_changed) self.connect('leave-notify-event', self._on_mouse_focus_changed) @@ -434,7 +435,9 @@ class ChatList(Gtk.ListBox, EventHelper): row.position = self._chat_order.index(row) self.emit('chat-order-changed') + self._pinned_order_change = True self.invalidate_sort() + self._pinned_order_change = False def _update_time(self) -> bool: for _key, row in self._chats.items(): @@ -474,7 +477,7 @@ class ChatList(Gtk.ListBox, EventHelper): row.set_header_type(None) def _sort_func(self, row1: ChatListRow, row2: ChatListRow) -> int: - if self._mouseover: + if self._mouseover and not self._pinned_order_change: log.debug('Mouseover active, don’t sort rows') return 0 |