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


Commits:
cd9885c0 by Daniel Brötzmann at 2019-10-23T14:25:45Z
HistoryWindow: Close search results first

This checks if the search results scrolled window is visible when pressing
Esc. It will first hide the scrolled window, and only then close the
history window.

- - - - -


1 changed file:

- gajim/gtk/history.py


Changes:

=====================================
gajim/gtk/history.py
=====================================
@@ -276,6 +276,9 @@ class HistoryWindow(Gtk.ApplicationWindow):
 
     def _on_key_press(self, widget, event):
         if event.keyval == Gdk.KEY_Escape:
+            if self._ui.results_scrolledwindow.get_visible():
+                self._ui.results_scrolledwindow.set_visible(False)
+                return
             self.save_state()
             self.destroy()
 
@@ -294,7 +297,7 @@ class HistoryWindow(Gtk.ApplicationWindow):
 
     def _jid_entry_search(self, jid):
         self._load_history(jid, self.account)
-        self._ui.results_scrolledwindow.set_property('visible', False)
+        self._ui.results_scrolledwindow.set_visible(False)
 
     def _load_history(self, jid_or_name, account=None):
         """
@@ -373,7 +376,7 @@ class HistoryWindow(Gtk.ApplicationWindow):
             self._ui.button_first_day.set_sensitive(False)
             self._ui.button_last_day.set_sensitive(False)
 
-            self._ui.results_scrolledwindow.set_property('visible', False)
+            self._ui.results_scrolledwindow.set_visible(False)
 
     def on_calendar_day_selected(self, widget):
         if not self.jid:
@@ -650,10 +653,10 @@ class HistoryWindow(Gtk.ApplicationWindow):
         self.history_buffer.remove_tag_by_name('highlight', start, end)
 
         if text == '':
-            self._ui.results_scrolledwindow.set_property('visible', False)
+            self._ui.results_scrolledwindow.set_visible(False)
             return
 
-        self._ui.results_scrolledwindow.set_property('visible', True)
+        self._ui.results_scrolledwindow.set_visible(True)
 
         # perform search in preselected jids
         # jids are preselected with the query_entry
@@ -804,7 +807,7 @@ class HistoryWindow(Gtk.ApplicationWindow):
             # Only in that case because it's called by
             # self._fill_completion_dict() otherwise
             self._load_history(jid, account)
-        self._ui.results_scrolledwindow.set_property('visible', False)
+        self._ui.results_scrolledwindow.set_visible(False)
 
     def save_state(self):
         x, y = self.get_window().get_root_origin()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/cd9885c0a1b2c55fd3ede70a20f3f2c4d29ee96b

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/cd9885c0a1b2c55fd3ede70a20f3f2c4d29ee96b
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to