Added fullscreen mode for special shortcuts

This commit is contained in:
Moritz Lipp 2010-05-24 11:41:08 +02:00
parent ecfe451807
commit 9936e31095
2 changed files with 59 additions and 47 deletions

View file

@ -108,6 +108,12 @@ Shortcut shortcuts[] = {
{0, GDK_l, sc_navigate_index, INDEX, { EXPAND } },
{0, GDK_space, sc_navigate_index, INDEX, { SELECT } },
{0, GDK_Return, sc_navigate_index, INDEX, { SELECT } },
{0, GDK_F5, sc_toggle_fullscreen, FULLSCREEN, {0} },
{0, GDK_Left, sc_navigate, FULLSCREEN, { PREVIOUS } },
{0, GDK_Up, sc_navigate, FULLSCREEN, { PREVIOUS } },
{0, GDK_Down, sc_navigate, FULLSCREEN, { NEXT } },
{0, GDK_Right, sc_navigate, FULLSCREEN, { NEXT } },
{0, GDK_space, sc_navigate, FULLSCREEN, { NEXT } },
};
/* inputbar shortcuts */

View file

@ -28,7 +28,7 @@ enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN,
FORWARD, BACKWARD, ADJUST_BESTFIT, ADJUST_WIDTH,
ADJUST_NONE, CONTINUOUS, DELETE_LAST, ADD_MARKER,
EVAL_MARKER, INDEX, EXPAND, COLLAPSE, SELECT,
GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET};
GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET, FULLSCREEN };
/* typedefs */
struct CElement
@ -1803,6 +1803,11 @@ sc_toggle_fullscreen(Argument* argument)
gtk_widget_hide(GTK_WIDGET(Zathura.UI.inputbar));
gtk_widget_hide(GTK_WIDGET(Zathura.UI.statusbar));
Argument arg;
arg.n = ADJUST_BESTFIT;
sc_adjust_window(&arg);
Zathura.Global.mode = FULLSCREEN;
fs = FALSE;
}
else
@ -1811,6 +1816,7 @@ sc_toggle_fullscreen(Argument* argument)
gtk_widget_show(GTK_WIDGET(Zathura.UI.inputbar));
gtk_widget_show(GTK_WIDGET(Zathura.UI.statusbar));
Zathura.Global.mode = NORMAL;
fs = TRUE;
}
}