From b6e1dc48935ec9a2dc91c9325a26d5d352a4d547 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Tue, 9 Aug 2022 17:59:28 +0200 Subject: Overload the F9 keyboard shortcut It doesn't make a lot of sense to be able to toggle invisible widgets, so just make F9 toggle "the toolbar that can currently be seen". The more permanent setting can be adjusted in GSettings. --- fiv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fiv.c b/fiv.c index 26d48a8..5aa38ec 100644 --- a/fiv.c +++ b/fiv.c @@ -148,7 +148,7 @@ static struct key_group help_keys_viewer[] = { {} }}, {"View", (struct key[]) { - {"F8", "Toggle toolbar"}, + {"F9", "Toggle toolbar"}, {"F5 r r", "Reload"}, {} }}, @@ -1311,10 +1311,6 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event, case GDK_KEY_F1: show_help_contents(); return TRUE; - case GDK_KEY_F9: - gtk_widget_set_visible(g.browser_sidebar, - !gtk_widget_is_visible(g.browser_sidebar)); - return TRUE; case GDK_KEY_F11: case GDK_KEY_f: toggle_fullscreen(); @@ -1351,8 +1347,7 @@ on_key_press_view(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event, switch (event->state & gtk_accelerator_get_default_mod_mask()) { case 0: switch (event->keyval) { - // XXX: The same shortcut focuses GtkPaned's handle. - case GDK_KEY_F8: + case GDK_KEY_F9: gtk_widget_set_visible(g.view_toolbar, !gtk_widget_is_visible(g.view_toolbar)); return TRUE; @@ -1411,6 +1406,11 @@ on_key_press_browser_paned(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event, break; case 0: switch (event->keyval) { + case GDK_KEY_F9: + gtk_widget_set_visible(g.browser_sidebar, + !gtk_widget_is_visible(g.browser_sidebar)); + return TRUE; + case GDK_KEY_Escape: fiv_browser_select(FIV_BROWSER(g.browser), NULL); return TRUE; -- cgit v1.2.3-70-g09d2