aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-18 21:53:08 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-18 22:08:45 +0100
commit9e45ba249efe9bee75e6a05d8aedbc0587603e55 (patch)
treeec78db7ff39b711085cf6cd37e09e72b4f39ef36
parentb23198f675f593573974ea39f1ec86042925802e (diff)
downloadfiv-9e45ba249efe9bee75e6a05d8aedbc0587603e55.tar.gz
fiv-9e45ba249efe9bee75e6a05d8aedbc0587603e55.tar.xz
fiv-9e45ba249efe9bee75e6a05d8aedbc0587603e55.zip
Bind fullscreen switching
Also, move Tab/Enter bindings to the view's key press handler.
-rw-r--r--fastiv.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/fastiv.c b/fastiv.c
index 8597a03..dc15bf9 100644
--- a/fastiv.c
+++ b/fastiv.c
@@ -338,13 +338,13 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,
gtk_widget_show(g.browser_sidebar);
return TRUE;
- case GDK_KEY_Tab:
- case GDK_KEY_Return:
- gtk_stack_set_visible_child(GTK_STACK(g.stack),
- gtk_stack_get_visible_child(GTK_STACK(g.stack)) ==
- g.view_scroller
- ? g.browser_paned
- : g.view_scroller);
+ case GDK_KEY_F11:
+ case GDK_KEY_f:
+ if (gdk_window_get_state(gtk_widget_get_window(g.window)) &
+ GDK_WINDOW_STATE_FULLSCREEN)
+ gtk_window_unfullscreen(GTK_WINDOW(g.window));
+ else
+ gtk_window_fullscreen(GTK_WINDOW(g.window));
return TRUE;
}
}
@@ -371,6 +371,11 @@ on_key_press_view(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,
on_next();
return TRUE;
}
+
+ case GDK_KEY_Tab:
+ case GDK_KEY_Return:
+ gtk_stack_set_visible_child(GTK_STACK(g.stack), g.browser_paned);
+ return TRUE;
}
return FALSE;
}