Use giraras toggle functions

This commit is contained in:
Moritz Lipp 2011-06-23 14:31:41 +02:00
parent 234b9785c9
commit 48c2d01bef
3 changed files with 62 additions and 110 deletions

View file

@ -94,9 +94,9 @@ config_load_default(zathura_t* zathura)
girara_shortcut_add(gsession, 0, GDK_n, NULL, sc_search, NORMAL, FORWARD, NULL);
girara_shortcut_add(gsession, 0, GDK_N, NULL, sc_search, NORMAL, BACKWARD, NULL);
girara_shortcut_add(gsession, 0, GDK_Tab, NULL, sc_toggle_index, NORMAL | INDEX, 0, NULL);
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_m, NULL, sc_toggle_inputbar, NORMAL, 0, NULL);
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_m, NULL, girara_sc_toggle_inputbar, NORMAL, 0, NULL);
girara_shortcut_add(gsession, 0, GDK_F5, NULL, sc_toggle_fullscreen, NORMAL | FULLSCREEN, 0, NULL);
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_n, NULL, sc_toggle_statusbar, NORMAL, 0, NULL);
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_n, NULL, girara_sc_toggle_statusbar, NORMAL, 0, NULL);
girara_shortcut_add(gsession, 0, GDK_q, NULL, sc_quit, NORMAL, 0, NULL);
girara_shortcut_add(gsession, 0, GDK_plus, NULL, sc_zoom, NORMAL | FULLSCREEN, ZOOM_IN, NULL);
girara_shortcut_add(gsession, 0, GDK_minus, NULL, sc_zoom, NORMAL | FULLSCREEN, ZOOM_OUT, NULL);
@ -132,8 +132,8 @@ config_load_default(zathura_t* zathura)
girara_shortcut_mapping_add(gsession, "search", sc_search);
girara_shortcut_mapping_add(gsession, "toggle_fullscreen", sc_toggle_fullscreen);
girara_shortcut_mapping_add(gsession, "toggle_index", sc_toggle_index);
girara_shortcut_mapping_add(gsession, "toggle_inputbar", sc_toggle_inputbar);
girara_shortcut_mapping_add(gsession, "toggle_statusbar", sc_toggle_statusbar);
girara_shortcut_mapping_add(gsession, "toggle_inputbar", girara_sc_toggle_inputbar);
girara_shortcut_mapping_add(gsession, "toggle_statusbar", girara_sc_toggle_statusbar);
girara_shortcut_mapping_add(gsession, "zoom", sc_zoom);
}

View file

@ -325,20 +325,6 @@ error_ret:
return false;
}
bool
sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument, unsigned int t)
{
g_return_val_if_fail(session != NULL, false);
if (gtk_widget_get_visible(GTK_WIDGET(session->gtk.inputbar))) {
gtk_widget_hide(GTK_WIDGET(session->gtk.inputbar));
} else {
gtk_widget_show(GTK_WIDGET(session->gtk.inputbar));
}
return false;
}
bool
sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, unsigned int t)
{
@ -357,20 +343,6 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, uns
return false;
}
bool
sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument, unsigned int t)
{
g_return_val_if_fail(session != NULL, false);
if (gtk_widget_get_visible(GTK_WIDGET(session->gtk.statusbar))) {
gtk_widget_hide(GTK_WIDGET(session->gtk.statusbar));
} else {
gtk_widget_show(GTK_WIDGET(session->gtk.statusbar));
}
return false;
}
bool
sc_quit(girara_session_t* session, girara_argument_t* argument, unsigned int t)
{

View file

@ -145,16 +145,6 @@ bool sc_navigate_index(girara_session_t* session, girara_argument_t* argument, u
*/
bool sc_toggle_index(girara_session_t* session, girara_argument_t* argument, unsigned int t);
/**
* Show/Hide the inputbar
*
* @param session The used girara session
* @param argument The used argument
* @param t Number of executions
* @return true if no error occured otherwise false
*/
bool sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument, unsigned int t);
/**
* Toggle fullscreen mode
*
@ -165,16 +155,6 @@ bool sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument,
*/
bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, unsigned int t);
/**
* Show/Hide the statusbar
*
* @param session The used girara session
* @param argument The used argument
* @param t Number of executions
* @return true if no error occured otherwise false
*/
bool sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument, unsigned int t);
/**
* Quit zathura
*