mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-30 10:54:56 +01:00
Merge branch 'develop' of pwmt.org:zathura into develop
This commit is contained in:
commit
89adcf38d4
4 changed files with 45 additions and 27 deletions
44
config.c
44
config.c
|
@ -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);
|
||||
|
@ -229,7 +231,7 @@ config_load_default(zathura_t* zathura)
|
|||
girara_shortcut_mapping_add(gsession, "change_mode", sc_change_mode);
|
||||
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);
|
||||
girara_shortcut_mapping_add(gsession, "navigate_index", sc_navigate_index);
|
||||
girara_shortcut_mapping_add(gsession, "navigate", sc_navigate);
|
||||
girara_shortcut_mapping_add(gsession, "quit", sc_quit);
|
||||
girara_shortcut_mapping_add(gsession, "recolor", sc_recolor);
|
||||
|
@ -244,24 +246,28 @@ config_load_default(zathura_t* zathura)
|
|||
girara_shortcut_mapping_add(gsession, "zoom", sc_zoom);
|
||||
|
||||
/* add argument mappings */
|
||||
girara_argument_mapping_add(gsession, "bottom", BOTTOM);
|
||||
girara_argument_mapping_add(gsession, "default", DEFAULT);
|
||||
girara_argument_mapping_add(gsession, "down", DOWN);
|
||||
girara_argument_mapping_add(gsession, "full-down", FULL_DOWN);
|
||||
girara_argument_mapping_add(gsession, "full-up", FULL_UP);
|
||||
girara_argument_mapping_add(gsession, "half-down", HALF_DOWN);
|
||||
girara_argument_mapping_add(gsession, "half-up", HALF_UP);
|
||||
girara_argument_mapping_add(gsession, "in", ZOOM_IN);
|
||||
girara_argument_mapping_add(gsession, "left", LEFT);
|
||||
girara_argument_mapping_add(gsession, "next", NEXT);
|
||||
girara_argument_mapping_add(gsession, "out", ZOOM_OUT);
|
||||
girara_argument_mapping_add(gsession, "previous", PREVIOUS);
|
||||
girara_argument_mapping_add(gsession, "right", RIGHT);
|
||||
girara_argument_mapping_add(gsession, "specific", ZOOM_SPECIFIC);
|
||||
girara_argument_mapping_add(gsession, "top", TOP);
|
||||
girara_argument_mapping_add(gsession, "up", UP);
|
||||
girara_argument_mapping_add(gsession, "best-fit", ADJUST_BESTFIT);
|
||||
girara_argument_mapping_add(gsession, "width", ADJUST_WIDTH);
|
||||
girara_argument_mapping_add(gsession, "bottom", BOTTOM);
|
||||
girara_argument_mapping_add(gsession, "default", DEFAULT);
|
||||
girara_argument_mapping_add(gsession, "collapse", COLLAPSE);
|
||||
girara_argument_mapping_add(gsession, "collapse-all", COLLAPSE_ALL);
|
||||
girara_argument_mapping_add(gsession, "down", DOWN);
|
||||
girara_argument_mapping_add(gsession, "expand", EXPAND);
|
||||
girara_argument_mapping_add(gsession, "expand-all", EXPAND_ALL);
|
||||
girara_argument_mapping_add(gsession, "full-down", FULL_DOWN);
|
||||
girara_argument_mapping_add(gsession, "full-up", FULL_UP);
|
||||
girara_argument_mapping_add(gsession, "half-down", HALF_DOWN);
|
||||
girara_argument_mapping_add(gsession, "half-up", HALF_UP);
|
||||
girara_argument_mapping_add(gsession, "in", ZOOM_IN);
|
||||
girara_argument_mapping_add(gsession, "left", LEFT);
|
||||
girara_argument_mapping_add(gsession, "next", NEXT);
|
||||
girara_argument_mapping_add(gsession, "out", ZOOM_OUT);
|
||||
girara_argument_mapping_add(gsession, "previous", PREVIOUS);
|
||||
girara_argument_mapping_add(gsession, "right", RIGHT);
|
||||
girara_argument_mapping_add(gsession, "specific", ZOOM_SPECIFIC);
|
||||
girara_argument_mapping_add(gsession, "top", TOP);
|
||||
girara_argument_mapping_add(gsession, "up", UP);
|
||||
girara_argument_mapping_add(gsession, "best-fit", ADJUST_BESTFIT);
|
||||
girara_argument_mapping_add(gsession, "width", ADJUST_WIDTH);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
18
shortcuts.c
18
shortcuts.c
|
@ -584,7 +584,7 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument,
|
|||
|
||||
switch(argument->n) {
|
||||
case UP:
|
||||
if(gtk_tree_path_prev(path) == FALSE) {
|
||||
if (gtk_tree_path_prev(path) == FALSE) {
|
||||
is_valid_path = gtk_tree_path_up(path);
|
||||
} else { /* row above */
|
||||
while(gtk_tree_view_row_expanded(tree_view, path)) {
|
||||
|
@ -598,14 +598,14 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument,
|
|||
}
|
||||
break;
|
||||
case COLLAPSE:
|
||||
if(!gtk_tree_view_collapse_row(tree_view, path)
|
||||
if (gtk_tree_view_collapse_row(tree_view, path) == FALSE
|
||||
&& gtk_tree_path_get_depth(path) > 1) {
|
||||
gtk_tree_path_up(path);
|
||||
gtk_tree_view_collapse_row(tree_view, path);
|
||||
}
|
||||
break;
|
||||
case DOWN:
|
||||
if(gtk_tree_view_row_expanded(tree_view, path)) {
|
||||
if (gtk_tree_view_row_expanded(tree_view, path) == TRUE) {
|
||||
gtk_tree_path_down(path);
|
||||
} else {
|
||||
do {
|
||||
|
@ -619,10 +619,19 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument,
|
|||
}
|
||||
break;
|
||||
case EXPAND:
|
||||
if(gtk_tree_view_expand_row(tree_view, path, FALSE)) {
|
||||
if (gtk_tree_view_expand_row(tree_view, path, FALSE)) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,8 +103,12 @@ k, j
|
|||
Move to upper or lower entry
|
||||
l
|
||||
Expand entry
|
||||
L
|
||||
Expand all entries
|
||||
h
|
||||
Collapse entry
|
||||
H
|
||||
Collapse all entries
|
||||
space, Return
|
||||
Select and open entry
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue