add EXPAND_ALL and COLLAPSE_ALL shortcuts to index

This commit is contained in:
Vicky Chijwani 2012-02-21 06:31:26 +05:30 committed by Moritz Lipp
parent 0c8fb2c598
commit 6aced3f870
3 changed files with 14 additions and 4 deletions

View File

@ -139,6 +139,8 @@ config_load_default(zathura_t* zathura)
girara_shortcut_add(gsession, 0, GDK_KEY_j, NULL, sc_navigate_index, INDEX, DOWN, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_h, NULL, sc_navigate_index, INDEX, COLLAPSE, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_l, NULL, sc_navigate_index, INDEX, EXPAND, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_L, NULL, sc_navigate_index, INDEX, EXPAND_ALL, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_H, NULL, sc_navigate_index, INDEX, COLLAPSE_ALL, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_Up, NULL, sc_navigate_index, INDEX, UP, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_Down, NULL, sc_navigate_index, INDEX, DOWN, NULL);
girara_shortcut_add(gsession, 0, GDK_KEY_Left, NULL, sc_navigate_index, INDEX, COLLAPSE, NULL);

View File

@ -623,6 +623,15 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument,
gtk_tree_path_down(path);
}
break;
case EXPAND_ALL:
gtk_tree_view_expand_all(tree_view);
break;
case COLLAPSE_ALL:
gtk_tree_view_collapse_all(tree_view);
gtk_tree_path_free(path);
path = gtk_tree_path_new_first();
gtk_tree_view_set_cursor(tree_view, path, NULL, FALSE);
break;
case SELECT:
cb_index_row_activated(tree_view, path, NULL, zathura);
return false;
@ -864,4 +873,3 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
return false;
}

View File

@ -14,9 +14,9 @@ enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT,
DELETE_LAST_WORD, DELETE_LAST_CHAR, DEFAULT, ERROR, WARNING, NEXT_GROUP,
PREVIOUS_GROUP, ZOOM_IN, ZOOM_OUT, ZOOM_ORIGINAL, ZOOM_SPECIFIC, FORWARD,
BACKWARD, ADJUST_BESTFIT, ADJUST_WIDTH, ADJUST_NONE, CONTINUOUS, DELETE_LAST,
ADD_MARKER, EVAL_MARKER, EXPAND, COLLAPSE, SELECT, GOTO_DEFAULT, GOTO_LABELS,
GOTO_OFFSET, HALF_UP, HALF_DOWN, FULL_UP, FULL_DOWN, NEXT_CHAR, PREVIOUS_CHAR,
DELETE_TO_LINE_START, APPEND_FILEPATH };
ADD_MARKER, EVAL_MARKER, EXPAND, EXPAND_ALL, COLLAPSE_ALL, COLLAPSE, SELECT,
GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET, HALF_UP, HALF_DOWN, FULL_UP,
FULL_DOWN, NEXT_CHAR, PREVIOUS_CHAR, DELETE_TO_LINE_START, APPEND_FILEPATH };
/* forward declaration for types from document.h */
struct zathura_document_s;