Skip to content
Snippets Groups Projects
Commit f11514ad authored by Philipp Hörist's avatar Philipp Hörist
Browse files

feat: Add new Shortcut for toggling the chat list

<Primary>R show/hides the chat list
parent 94739a89
No related branches found
No related tags found
No related merge requests found
......@@ -175,6 +175,13 @@
<object class="GtkShortcutsGroup">
<property name="visible">1</property>
<property name="title" translatable="yes">Tabs</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">&lt;primary&gt;R</property>
<property name="title" translatable="yes">Toggle Chat List</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
......
......@@ -30,5 +30,6 @@
"win.switch-tab-7": ["<Alt>7", "<Alt>KP_7"],
"win.switch-tab-8": ["<Alt>8", "<Alt>KP_8"],
"win.switch-tab-9": ["<Alt>9", "<Alt>KP_9"],
"win.search-history": ["<Primary>H"]
"win.search-history": ["<Primary>H"],
"win.hide-chat-list": ["<Primary>R"]
}
......@@ -313,3 +313,8 @@ def hide_search(self) -> bool:
self._search_revealer.set_reveal_child(False)
return True
return False
def toggle_chat_list(self) -> None:
chat_list = self._ui.paned.get_child1()
assert chat_list is not None
chat_list.set_visible(not chat_list.get_visible())
......@@ -343,6 +343,7 @@ def _add_actions2(self) -> None:
'switch-tab-7',
'switch-tab-8',
'switch-tab-9',
'toggle-chat-list',
]
disabled_for_emacs = (
......@@ -403,6 +404,9 @@ def _on_action(self,
number = int(action_name[-1]) - 1
self.select_chat_number(number)
elif action_name == 'toggle-chat-list':
self._chat_page.toggle_chat_list()
return None
def _on_window_motion_notify(self,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment