feat: `Ctrl+Q` quit shortcut (#70)

This commit is contained in:
DaPigGuy 2023-02-09 15:02:37 -08:00 committed by GitHub
parent 18e66885ee
commit 28b3c9a647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -53,6 +53,7 @@ namespace Tooth {
{ "back", back_activated },
{ "refresh", refresh_activated },
{ "search", search_activated },
{ "quit", quit_activated }
};
construct {
@ -65,6 +66,7 @@ namespace Tooth {
public string[] ACCEL_BACK = {"<Alt>BackSpace", "<Alt>Left"};
public string[] ACCEL_REFRESH = {"<Ctrl>R", "F5"};
public string[] ACCEL_SEARCH = {"<Ctrl>F"};
public string[] ACCEL_QUIT = {"<Ctrl>Q"};
public static int main (string[] args) {
try {
@ -125,6 +127,7 @@ namespace Tooth {
set_accels_for_action ("app.back", ACCEL_BACK);
set_accels_for_action ("app.refresh", ACCEL_REFRESH);
set_accels_for_action ("app.search", ACCEL_SEARCH);
set_accels_for_action ("app.quit", ACCEL_QUIT);
add_action_entries (app_entries, this);
}
@ -196,6 +199,10 @@ namespace Tooth {
main_window.open_view (new Views.Search ());
}
void quit_activated () {
app.quit ();
}
void refresh_activated () {
refresh ();
}