Added ctrl+w shortcut to delete current chat.

This commit is contained in:
root 2024-10-16 19:48:17 -03:00
parent 134a907eff
commit f1f8673b8e
2 changed files with 10 additions and 2 deletions

View File

@ -56,7 +56,8 @@ class AlpacaApplication(Adw.Application):
def __init__(self, version): def __init__(self, version):
super().__init__(application_id='com.jeffser.Alpaca', super().__init__(application_id='com.jeffser.Alpaca',
flags=Gio.ApplicationFlags.DEFAULT_FLAGS) flags=Gio.ApplicationFlags.DEFAULT_FLAGS)
self.create_action('quit', lambda *_: self.props.active_window.closing_app(None), ['<primary>w', '<primary>q']) self.create_action('quit', lambda *_: self.props.active_window.closing_app(None), ['<primary>q'])
self.set_accels_for_action('app.delete_current_chat', ['<primary>w'])
self.create_action('preferences', lambda *_: self.props.active_window.preferences_dialog.present(self.props.active_window), ['<primary>comma']) self.create_action('preferences', lambda *_: self.props.active_window.preferences_dialog.present(self.props.active_window), ['<primary>comma'])
self.create_action('about', self.on_about_action) self.create_action('about', self.on_about_action)
self.set_accels_for_action("win.show-help-overlay", ['<primary>slash']) self.set_accels_for_action("win.show-help-overlay", ['<primary>slash'])

View File

@ -1127,10 +1127,16 @@
<property name="title" translatable="yes">General</property> <property name="title" translatable="yes">General</property>
<child> <child>
<object class="GtkShortcutsShortcut"> <object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;W</property> <property name="accelerator">&lt;ctrl&gt;Q</property>
<property name="title" translatable="yes">Close application</property> <property name="title" translatable="yes">Close application</property>
</object> </object>
</child> </child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;W</property>
<property name="title" translatable="yes">Delete current chat</property>
</object>
</child>
<child> <child>
<object class="GtkShortcutsShortcut"> <object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;I</property> <property name="accelerator">&lt;ctrl&gt;I</property>
@ -1216,3 +1222,4 @@
</interface> </interface>