mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:46:00 +01:00
Use girara's focus_inputbar function
zathura's focus_inputbar function is a duplicate of girara's one. This patch removes it. Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Sebastian Ramacher <s.ramacher@gmx.at>
This commit is contained in:
parent
a6268788c0
commit
2b4f5d1823
3 changed files with 6 additions and 40 deletions
13
config.c
13
config.c
|
@ -52,12 +52,12 @@ config_load_default(zathura_t* zathura)
|
|||
girara_shortcut_add(gsession, 0, GDK_i, NULL, sc_change_mode, NORMAL, INSERT, NULL);
|
||||
girara_shortcut_add(gsession, 0, GDK_m, NULL, sc_change_mode, NORMAL, ADD_MARKER, NULL);
|
||||
girara_shortcut_add(gsession, 0, GDK_apostrophe, NULL, sc_change_mode, NORMAL, EVAL_MARKER, NULL);
|
||||
girara_shortcut_add(gsession, 0, GDK_slash, NULL, sc_focus_inputbar, NORMAL, 0, &("/"));
|
||||
girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_slash, NULL, sc_focus_inputbar, NORMAL, 0, &("/"));
|
||||
girara_shortcut_add(gsession, 0, GDK_question, NULL, sc_focus_inputbar, NORMAL, 0, &("?"));
|
||||
girara_shortcut_add(gsession, 0, GDK_colon, NULL, sc_focus_inputbar, NORMAL, 0, &(":"));
|
||||
girara_shortcut_add(gsession, 0, GDK_o, NULL, sc_focus_inputbar, NORMAL, 0, &(":open "));
|
||||
girara_shortcut_add(gsession, 0, GDK_O, NULL, sc_focus_inputbar, NORMAL, APPEND_FILEPATH, &(":open "));
|
||||
girara_shortcut_add(gsession, 0, GDK_slash, NULL, girara_sc_focus_inputbar, NORMAL, 0, &("/"));
|
||||
girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_slash, NULL, girara_sc_focus_inputbar, NORMAL, 0, &("/"));
|
||||
girara_shortcut_add(gsession, 0, GDK_question, NULL, girara_sc_focus_inputbar, NORMAL, 0, &("?"));
|
||||
girara_shortcut_add(gsession, 0, GDK_colon, NULL, girara_sc_focus_inputbar, NORMAL, 0, &(":"));
|
||||
girara_shortcut_add(gsession, 0, GDK_o, NULL, girara_sc_focus_inputbar, NORMAL, 0, &(":open "));
|
||||
girara_shortcut_add(gsession, 0, GDK_O, NULL, girara_sc_focus_inputbar, NORMAL, APPEND_FILEPATH, &(":open "));
|
||||
girara_shortcut_add(gsession, 0, GDK_f, NULL, sc_follow, NORMAL, 0, NULL);
|
||||
girara_shortcut_add(gsession, 0, 0, "gg", sc_goto, NORMAL | FULLSCREEN, TOP, NULL);
|
||||
girara_shortcut_add(gsession, 0, 0, "G", sc_goto, NORMAL | FULLSCREEN, BOTTOM, NULL);
|
||||
|
@ -122,7 +122,6 @@ config_load_default(zathura_t* zathura)
|
|||
girara_shortcut_mapping_add(gsession, "abort", sc_abort);
|
||||
girara_shortcut_mapping_add(gsession, "adjust_window", sc_adjust_window);
|
||||
girara_shortcut_mapping_add(gsession, "change_mode", sc_change_mode);
|
||||
girara_shortcut_mapping_add(gsession, "focus_inputbar", sc_focus_inputbar);
|
||||
girara_shortcut_mapping_add(gsession, "follow", sc_follow);
|
||||
girara_shortcut_mapping_add(gsession, "goto", sc_goto);
|
||||
girara_shortcut_mapping_add(gsession, "index_navigate", sc_navigate_index);
|
||||
|
|
23
shortcuts.c
23
shortcuts.c
|
@ -41,29 +41,6 @@ sc_change_mode(girara_session_t* session, girara_argument_t* argument, unsigned
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument,
|
||||
unsigned int UNUSED(t))
|
||||
{
|
||||
g_return_val_if_fail(session != NULL, false);
|
||||
|
||||
if (!(gtk_widget_get_visible(GTK_WIDGET(session->gtk.inputbar)))) {
|
||||
gtk_widget_show(GTK_WIDGET(session->gtk.inputbar));
|
||||
}
|
||||
|
||||
if (gtk_widget_get_visible(GTK_WIDGET(session->gtk.notification_area))) {
|
||||
gtk_widget_hide(GTK_WIDGET(session->gtk.notification_area));
|
||||
}
|
||||
|
||||
if (argument->data) {
|
||||
gtk_entry_set_text(session->gtk.inputbar, (char*) argument->data);
|
||||
gtk_widget_grab_focus(GTK_WIDGET(session->gtk.inputbar));
|
||||
gtk_editable_set_position(GTK_EDITABLE(session->gtk.inputbar), -1);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
||||
unsigned int UNUSED(t))
|
||||
|
|
10
shortcuts.h
10
shortcuts.h
|
@ -35,16 +35,6 @@ bool sc_adjust_window(girara_session_t* session, girara_argument_t* argument, un
|
|||
*/
|
||||
bool sc_change_mode(girara_session_t* session, girara_argument_t* argument, unsigned int t);
|
||||
|
||||
/**
|
||||
* Focus 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_focus_inputbar(girara_session_t* session, girara_argument_t* argument, unsigned int t);
|
||||
|
||||
/**
|
||||
* Follow a link
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue