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


Commits:
e8855528 by wurstsalat at 2025-09-07T09:08:35+02:00
feat: Chats: Add shortcut to focus chat search

Use Primary+K
Closes #12452

- - - - -


2 changed files:

- gajim/gtk/chat_page.py
- gajim/gtk/const.py


Changes:

=====================================
gajim/gtk/chat_page.py
=====================================
@@ -92,6 +92,7 @@ def _transform_to_bool(binding: GObject.Binding, value: 
GLib.Variant) -> bool:
 
     def _add_actions(self):
         actions = [
+            ("focus-search", None, self._on_focus_search),
             ("remove-chat", "as", self._remove_chat),
             ("search-history", None, self._on_search_history),
         ]
@@ -154,6 +155,12 @@ def _on_chat_unselected(self, _chat_list_stack: 
ChatListStack) -> None:
         self._chat_stack.clear()
         self._search_view.set_context(None, None)
 
+    def _on_focus_search(
+        self, _action: Gio.SimpleAction, _param: Literal[None]
+    ) -> None:
+        search_entry = self._chat_list_header.get_search_entry()
+        search_entry.grab_focus()
+
     def _on_search_history(
         self, _action: Gio.SimpleAction, _param: Literal[None]
     ) -> None:


=====================================
gajim/gtk/const.py
=====================================
@@ -386,8 +386,11 @@ class ShortcutData:
         label=_("Reset Font Size"), category="general", 
accelerators=["<Primary>0"]
     ),
     # chats
+    "win.focus-search": ShortcutData(
+        label=_("Focus Search"), category="chats", accelerators=["<Primary>K"]
+    ),
     "win.search-history": ShortcutData(
-        label=_("Search"), category="chats", accelerators=["<Primary>F"]
+        label=_("Search Chat History"), category="chats", 
accelerators=["<Primary>F"]
     ),
     "win.show-contact-info": ShortcutData(
         label=_("Contact Details"), category="chats", 
accelerators=["<Primary>I"]



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

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


_______________________________________________
Commits mailing list -- commits@gajim.org
To unsubscribe send an email to commits-le...@gajim.org

Reply via email to