Added new shortcut for creating a chat

This commit is contained in:
jeffser 2024-05-28 22:45:26 -06:00
parent 8672c4ac40
commit 2645ab3732
2 changed files with 7 additions and 0 deletions

View File

@ -862,6 +862,7 @@ class AlpacaWindow(Adw.ApplicationWindow):
GtkSource.init() GtkSource.init()
self.set_help_overlay(self.shortcut_window) self.set_help_overlay(self.shortcut_window)
self.get_application().set_accels_for_action("win.show-help-overlay", ['<primary>slash']) self.get_application().set_accels_for_action("win.show-help-overlay", ['<primary>slash'])
self.get_application().create_action('new_chat', lambda *_: self.new_chat(), ['<primary>n'])
self.get_application().create_action('clear', lambda *_: dialogs.clear_chat(self), ['<primary>e']) self.get_application().create_action('clear', lambda *_: dialogs.clear_chat(self), ['<primary>e'])
self.get_application().create_action('send', lambda *_: self.send_message(self), ['Return']) self.get_application().create_action('send', lambda *_: self.send_message(self), ['Return'])
self.add_chat_button.connect("clicked", lambda button : self.new_chat()) self.add_chat_button.connect("clicked", lambda button : self.new_chat())

View File

@ -605,6 +605,12 @@
<property name="title" translatable="yes">Preferences</property> <property name="title" translatable="yes">Preferences</property>
</object> </object>
</child> </child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;N</property>
<property name="title" translatable="yes">New Chat</property>
</object>
</child>
<child> <child>
<object class="GtkShortcutsShortcut"> <object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;slash</property> <property name="accelerator">&lt;ctrl&gt;slash</property>