Mercurial > pidgin
diff console/libgnt/gnttree.c @ 14216:e9dd2f76e61b
[gaim-migrate @ 16897]
A couple more keybindings.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 20 Aug 2006 07:11:09 +0000 |
parents | e9304dd00992 |
children | f3ef96e8428f |
line wrap: on
line diff
--- a/console/libgnt/gnttree.c Sun Aug 20 02:24:15 2006 +0000 +++ b/console/libgnt/gnttree.c Sun Aug 20 07:11:09 2006 +0000 @@ -490,6 +490,41 @@ else redraw_tree(tree); } + else if (strcmp(text+1, GNT_KEY_PGDOWN) == 0) + { + row = get_next(tree->bottom); + if (row) + { + int dist = get_distance(tree->top, tree->current); + tree->top = tree->bottom; + tree->current = get_next_n_opt(tree->top, dist, NULL); + redraw_tree(tree); + } + else if (tree->current != tree->bottom) + { + tree->current = tree->bottom; + redraw_tree(tree); + } + } + else if (strcmp(text+1, GNT_KEY_PGUP) == 0) + { + if (tree->top != tree->root) + { + int dist = get_distance(tree->top, tree->current); + row = get_prev_n(tree->top, widget->priv.height - 1 - + tree->show_title * 2 - 2 * (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER) == 0)); + if (row == NULL) + row = tree->root; + tree->top = row; + tree->current = get_next_n_opt(tree->top, dist, NULL); + redraw_tree(tree); + } + else if (tree->current != tree->top) + { + tree->current = tree->top; + redraw_tree(tree); + } + } } else if (iscntrl(text[0])) {