aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-09 17:59:28 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-09 18:03:55 +0200
commitb6e1dc48935ec9a2dc91c9325a26d5d352a4d547 (patch)
tree13702dcdb18b714133ff9b219830b9880c5087e2
parentf94550ec61b33a9c26e5d6ecb9d36a99556f45d9 (diff)
downloadfiv-b6e1dc48935ec9a2dc91c9325a26d5d352a4d547.tar.gz
fiv-b6e1dc48935ec9a2dc91c9325a26d5d352a4d547.tar.xz
fiv-b6e1dc48935ec9a2dc91c9325a26d5d352a4d547.zip
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.
-rw-r--r--fiv.c14
1 files 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 <Primary>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;