Bind hiding the toolbar
This commit is contained in:
parent
f435252492
commit
6a61d01f4d
10
fastiv.c
10
fastiv.c
@ -126,6 +126,7 @@ struct {
|
|||||||
GtkWidget *browser;
|
GtkWidget *browser;
|
||||||
|
|
||||||
GtkWidget *view_box;
|
GtkWidget *view_box;
|
||||||
|
GtkWidget *view_toolbar;
|
||||||
GtkWidget *toolbar[TOOLBAR_COUNT];
|
GtkWidget *toolbar[TOOLBAR_COUNT];
|
||||||
GtkWidget *view;
|
GtkWidget *view;
|
||||||
} g;
|
} g;
|
||||||
@ -642,6 +643,11 @@ on_key_press_view(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,
|
|||||||
switch (event->state & gtk_accelerator_get_default_mod_mask()) {
|
switch (event->state & gtk_accelerator_get_default_mod_mask()) {
|
||||||
case 0:
|
case 0:
|
||||||
switch (event->keyval) {
|
switch (event->keyval) {
|
||||||
|
case GDK_KEY_F8:
|
||||||
|
gtk_widget_set_visible(g.view_toolbar,
|
||||||
|
!gtk_widget_is_visible(g.view_toolbar));
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
case GDK_KEY_Left:
|
case GDK_KEY_Left:
|
||||||
case GDK_KEY_Up:
|
case GDK_KEY_Up:
|
||||||
case GDK_KEY_Page_Up:
|
case GDK_KEY_Page_Up:
|
||||||
@ -1036,8 +1042,8 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Need to put the toolbar at the top, because of the horizontal scrollbar.
|
// Need to put the toolbar at the top, because of the horizontal scrollbar.
|
||||||
g.view_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
g.view_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||||
GtkWidget *view_toolbar = make_view_toolbar();
|
g.view_toolbar = make_view_toolbar();
|
||||||
gtk_box_pack_start(GTK_BOX(g.view_box), view_toolbar, FALSE, FALSE, 0);
|
gtk_box_pack_start(GTK_BOX(g.view_box), g.view_toolbar, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start(GTK_BOX(g.view_box),
|
gtk_box_pack_start(GTK_BOX(g.view_box),
|
||||||
gtk_separator_new(GTK_ORIENTATION_VERTICAL), FALSE, FALSE, 0);
|
gtk_separator_new(GTK_ORIENTATION_VERTICAL), FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start(GTK_BOX(g.view_box), view_scroller, TRUE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(g.view_box), view_scroller, TRUE, TRUE, 0);
|
||||||
|
@ -816,7 +816,7 @@ fiv_view_key_press_event(GtkWidget *widget, GdkEventKey *event)
|
|||||||
case GDK_KEY_minus:
|
case GDK_KEY_minus:
|
||||||
return command(self, FIV_VIEW_COMMAND_ZOOM_OUT);
|
return command(self, FIV_VIEW_COMMAND_ZOOM_OUT);
|
||||||
|
|
||||||
case GDK_KEY_x: // Inspired by gThumb.
|
case GDK_KEY_x: // Inspired by gThumb, which has more such modes.
|
||||||
return command(self, FIV_VIEW_COMMAND_TOGGLE_SCALE_TO_FIT);
|
return command(self, FIV_VIEW_COMMAND_TOGGLE_SCALE_TO_FIT);
|
||||||
case GDK_KEY_i:
|
case GDK_KEY_i:
|
||||||
return command(self, FIV_VIEW_COMMAND_TOGGLE_FILTER);
|
return command(self, FIV_VIEW_COMMAND_TOGGLE_FILTER);
|
||||||
|
Loading…
Reference in New Issue
Block a user