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


Commits:
5ae9584c by wurstsalat at 2021-10-02T00:10:04+02:00
SearchView: Imrprove Revealer behavior

- - - - -


3 changed files:

- gajim/gtk/chat_page.py
- gajim/gtk/main.py
- gajim/gtk/search_view.py


Changes:

=====================================
gajim/gtk/chat_page.py
=====================================
@@ -19,7 +19,6 @@
 from gi.repository import GObject
 
 from gajim.common import app
-from gajim.common.i18n import _
 
 from .util import get_builder
 from .chat_filter import ChatFilter
@@ -49,9 +48,10 @@ def __init__(self):
         self._search_view.connect('hide-search', self._on_search_hide)
 
         self._search_revealer = Gtk.Revealer()
-        self._search_revealer.set_reveal_child(True)
+        self._search_revealer.set_reveal_child(False)
+        self._search_revealer.set_transition_type(
+            Gtk.RevealerTransitionType.SLIDE_LEFT)
         self._search_revealer.set_halign(Gtk.Align.END)
-        self._search_revealer.set_no_show_all(True)
         self._search_revealer.add(self._search_view)
         self._ui.right_grid_overlay.add_overlay(self._search_revealer)
 
@@ -139,11 +139,11 @@ def _on_search_history(self, _action, _param):
         if control is not None:
             self._search_view.set_context(control.account, control.contact.jid)
         self._search_view.clear()
-        self._search_revealer.show()
+        self._search_revealer.set_reveal_child(True)
         self._search_view.set_focus()
 
     def _on_search_hide(self, *args):
-        self._search_revealer.hide()
+        self._search_revealer.set_reveal_child(False)
 
     def _on_chat_list_changed(self, chat_list_stack, *args):
         chat_list = chat_list_stack.get_current_chat_list()
@@ -268,4 +268,6 @@ def get_controls(self, account=None):
 
     def hide_search(self):
         if self._search_revealer.get_reveal_child():
-            self._search_revealer.hide()
+            self._search_revealer.set_reveal_child(False)
+            return True
+        return False


=====================================
gajim/gtk/main.py
=====================================
@@ -215,7 +215,8 @@ def _on_action(self, action, _param):
             return res
 
         if action == 'escape':
-            self._chat_page.hide_search()
+            if self._chat_page.hide_search():
+                return
 
         if action == 'escape' and app.settings.get('escape_key_closes'):
             self._chat_page.remove_chat(control.account, control.contact.jid)


=====================================
gajim/gtk/search_view.py
=====================================
@@ -55,7 +55,6 @@ def __init__(self):
         self.add(self._ui.search_box)
 
         self._ui.connect_signals(self)
-        self.connect('key-press-event', self._on_key_press)
 
         app.ged.register_event_handler('account-enabled',
                                        ged.GUI1,
@@ -65,10 +64,6 @@ def __init__(self):
                                        self._on_account_state)
         self.show_all()
 
-    def _on_key_press(self, _widget, event):
-        if event.keyval == Gdk.KEY_Escape:
-            self.emit('hide-search')
-
     def _on_account_state(self, _event):
         self.clear()
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/5ae9584c333c90be1587faed18735a45ac5cd77f

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


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to