mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-26 22:16:01 +01:00
Added fullscreen mode for special shortcuts
This commit is contained in:
parent
ecfe451807
commit
9936e31095
2 changed files with 59 additions and 47 deletions
98
config.def.h
98
config.def.h
|
@ -62,52 +62,58 @@ static const char DEFAULT_TEXT[] = "[No Name]";
|
|||
|
||||
/* shortcuts */
|
||||
Shortcut shortcuts[] = {
|
||||
/* mask, key, function, mode, argument */
|
||||
{GDK_CONTROL_MASK, GDK_n, sc_toggle_statusbar, NORMAL, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_m, sc_toggle_inputbar, NORMAL, {0} },
|
||||
{0, GDK_F5, sc_toggle_fullscreen, NORMAL, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_q, sc_quit, -1, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_c, sc_abort, -1, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_i, sc_recolor, NORMAL, {0} },
|
||||
{0, GDK_slash, sc_focus_inputbar, NORMAL, { .data = "/" } },
|
||||
{GDK_SHIFT_MASK, GDK_slash, sc_focus_inputbar, NORMAL, { .data = "/" } },
|
||||
{GDK_SHIFT_MASK, GDK_question, sc_focus_inputbar, NORMAL, { .data = "?" } },
|
||||
{0, GDK_Tab, sc_toggle_index, NORMAL, {0} },
|
||||
{0, GDK_Tab, sc_toggle_index, INDEX, {0} },
|
||||
{0, GDK_J, sc_navigate, NORMAL, { NEXT } },
|
||||
{0, GDK_K, sc_navigate, NORMAL, { PREVIOUS } },
|
||||
{GDK_MOD1_MASK, GDK_Right, sc_navigate, NORMAL, { NEXT } },
|
||||
{GDK_MOD1_MASK, GDK_Left, sc_navigate, NORMAL, { PREVIOUS } },
|
||||
{0, GDK_O, sc_switch_goto_mode, NORMAL, {0} },
|
||||
{0, GDK_space, sc_navigate, NORMAL, { NEXT } },
|
||||
{0, GDK_Escape, sc_abort, -1, {0} },
|
||||
{0, GDK_i, sc_change_mode, NORMAL, { INSERT } },
|
||||
{0, GDK_v, sc_change_mode, NORMAL, { VISUAL } },
|
||||
{0, GDK_m, sc_change_mode, NORMAL, { ADD_MARKER } },
|
||||
{0, GDK_apostrophe, sc_change_mode, NORMAL, { EVAL_MARKER } },
|
||||
{0, GDK_colon, sc_focus_inputbar, NORMAL, { .data = ":" } },
|
||||
{0, GDK_o, sc_focus_inputbar, NORMAL, { .data = ":open " } },
|
||||
{0, GDK_f, sc_follow, NORMAL, {0} },
|
||||
{0, GDK_r, sc_rotate, NORMAL, {0} },
|
||||
{0, GDK_h, sc_scroll, NORMAL, { LEFT } },
|
||||
{0, GDK_j, sc_scroll, NORMAL, { DOWN } },
|
||||
{0, GDK_k, sc_scroll, NORMAL, { UP } },
|
||||
{0, GDK_l, sc_scroll, NORMAL, { RIGHT } },
|
||||
{0, GDK_Left, sc_scroll, NORMAL, { LEFT } },
|
||||
{0, GDK_Up, sc_scroll, NORMAL, { UP } },
|
||||
{0, GDK_Down, sc_scroll, NORMAL, { DOWN } },
|
||||
{0, GDK_Right, sc_scroll, NORMAL, { RIGHT } },
|
||||
{0, GDK_n, sc_search, NORMAL, { FORWARD } },
|
||||
{0, GDK_N, sc_search, NORMAL, { BACKWARD } },
|
||||
{0, GDK_a, sc_adjust_window, NORMAL, { ADJUST_BESTFIT } },
|
||||
{0, GDK_s, sc_adjust_window, NORMAL, { ADJUST_WIDTH } },
|
||||
{0, GDK_BackSpace, sc_change_buffer, -1, { DELETE_LAST } },
|
||||
{0, GDK_k, sc_navigate_index, INDEX, { UP } },
|
||||
{0, GDK_j, sc_navigate_index, INDEX, { DOWN } },
|
||||
{0, GDK_h, sc_navigate_index, INDEX, { COLLAPSE } },
|
||||
{0, GDK_l, sc_navigate_index, INDEX, { EXPAND } },
|
||||
{0, GDK_space, sc_navigate_index, INDEX, { SELECT } },
|
||||
{0, GDK_Return, sc_navigate_index, INDEX, { SELECT } },
|
||||
/* mask, key, function, mode, argument */
|
||||
{GDK_CONTROL_MASK, GDK_n, sc_toggle_statusbar, NORMAL, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_m, sc_toggle_inputbar, NORMAL, {0} },
|
||||
{0, GDK_F5, sc_toggle_fullscreen, NORMAL, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_q, sc_quit, -1, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_c, sc_abort, -1, {0} },
|
||||
{GDK_CONTROL_MASK, GDK_i, sc_recolor, NORMAL, {0} },
|
||||
{0, GDK_slash, sc_focus_inputbar, NORMAL, { .data = "/" } },
|
||||
{GDK_SHIFT_MASK, GDK_slash, sc_focus_inputbar, NORMAL, { .data = "/" } },
|
||||
{GDK_SHIFT_MASK, GDK_question, sc_focus_inputbar, NORMAL, { .data = "?" } },
|
||||
{0, GDK_Tab, sc_toggle_index, NORMAL, {0} },
|
||||
{0, GDK_Tab, sc_toggle_index, INDEX, {0} },
|
||||
{0, GDK_J, sc_navigate, NORMAL, { NEXT } },
|
||||
{0, GDK_K, sc_navigate, NORMAL, { PREVIOUS } },
|
||||
{GDK_MOD1_MASK, GDK_Right, sc_navigate, NORMAL, { NEXT } },
|
||||
{GDK_MOD1_MASK, GDK_Left, sc_navigate, NORMAL, { PREVIOUS } },
|
||||
{0, GDK_O, sc_switch_goto_mode, NORMAL, {0} },
|
||||
{0, GDK_space, sc_navigate, NORMAL, { NEXT } },
|
||||
{0, GDK_Escape, sc_abort, -1, {0} },
|
||||
{0, GDK_i, sc_change_mode, NORMAL, { INSERT } },
|
||||
{0, GDK_v, sc_change_mode, NORMAL, { VISUAL } },
|
||||
{0, GDK_m, sc_change_mode, NORMAL, { ADD_MARKER } },
|
||||
{0, GDK_apostrophe, sc_change_mode, NORMAL, { EVAL_MARKER } },
|
||||
{0, GDK_colon, sc_focus_inputbar, NORMAL, { .data = ":" } },
|
||||
{0, GDK_o, sc_focus_inputbar, NORMAL, { .data = ":open " } },
|
||||
{0, GDK_f, sc_follow, NORMAL, {0} },
|
||||
{0, GDK_r, sc_rotate, NORMAL, {0} },
|
||||
{0, GDK_h, sc_scroll, NORMAL, { LEFT } },
|
||||
{0, GDK_j, sc_scroll, NORMAL, { DOWN } },
|
||||
{0, GDK_k, sc_scroll, NORMAL, { UP } },
|
||||
{0, GDK_l, sc_scroll, NORMAL, { RIGHT } },
|
||||
{0, GDK_Left, sc_scroll, NORMAL, { LEFT } },
|
||||
{0, GDK_Up, sc_scroll, NORMAL, { UP } },
|
||||
{0, GDK_Down, sc_scroll, NORMAL, { DOWN } },
|
||||
{0, GDK_Right, sc_scroll, NORMAL, { RIGHT } },
|
||||
{0, GDK_n, sc_search, NORMAL, { FORWARD } },
|
||||
{0, GDK_N, sc_search, NORMAL, { BACKWARD } },
|
||||
{0, GDK_a, sc_adjust_window, NORMAL, { ADJUST_BESTFIT } },
|
||||
{0, GDK_s, sc_adjust_window, NORMAL, { ADJUST_WIDTH } },
|
||||
{0, GDK_BackSpace, sc_change_buffer, -1, { DELETE_LAST } },
|
||||
{0, GDK_k, sc_navigate_index, INDEX, { UP } },
|
||||
{0, GDK_j, sc_navigate_index, INDEX, { DOWN } },
|
||||
{0, GDK_h, sc_navigate_index, INDEX, { COLLAPSE } },
|
||||
{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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue