Mercurial > pidgin.yaz
changeset 14107:c0ee28af3ca2
[gaim-migrate @ 16741]
Show little scroll-arrows for trees and textviews when appropriate.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 14 Aug 2006 02:16:58 +0000 |
parents | a82d407d38fa |
children | 7a205b430d19 |
files | console/libgnt/gntmain.c console/libgnt/gnttextview.c console/libgnt/gnttree.c |
diffstat | 3 files changed, 31 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/console/libgnt/gntmain.c Mon Aug 14 00:08:15 2006 +0000 +++ b/console/libgnt/gntmain.c Mon Aug 14 02:16:58 2006 +0000 @@ -399,6 +399,10 @@ case 'j': case 'n': ch = '+'; break; + case '-': + ch = '^'; break; + case '.': + ch = 'v'; break; default: ch = ' '; break; }
--- a/console/libgnt/gnttextview.c Mon Aug 14 00:08:15 2006 +0000 +++ b/console/libgnt/gnttextview.c Mon Aug 14 02:16:58 2006 +0000 @@ -46,6 +46,18 @@ } } + mvwaddch(widget->window, 0, + widget->priv.width - 1, + lines ? + ACS_UARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : + ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); + + mvwaddch(widget->window, widget->priv.height - 1, + widget->priv.width - 1, + (view->list && view->list->prev) ? + ACS_DARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : + ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); + DEBUG; }
--- a/console/libgnt/gnttree.c Mon Aug 14 00:08:15 2006 +0000 +++ b/console/libgnt/gnttree.c Mon Aug 14 02:16:58 2006 +0000 @@ -223,7 +223,7 @@ text = g_utf8_offset_to_pointer(col->text, len - fl); string = g_string_append_len(string, col->text, text - col->text); - if (len < tree->columns[i].width) + if (len < tree->columns[i].width && iter->next) g_string_append_printf(string, "%*s", tree->columns[i].width - len, ""); } return g_string_free(string, FALSE); @@ -306,6 +306,12 @@ else if (up >= widget->priv.height - pos) tree->top = get_prev_n(tree->current, nr); + mvwaddch(widget->window, start + pos, + widget->priv.width - pos - 1, + (tree->top != tree->root) ? + ACS_UARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : + ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); + row = tree->top; for (start = start + pos; row && start < widget->priv.height - pos; start++, row = get_next(row)) @@ -351,17 +357,23 @@ wbkgdset(widget->window, '\0' | attr); mvwprintw(widget->window, start, pos, str); - whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1)); + whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1) - 1); tree->bottom = row; g_free(str); tree_mark_columns(tree, pos, start, ACS_VLINE | attr); } + mvwaddch(widget->window, widget->priv.height - pos - 1, + widget->priv.width - pos - 1, + get_next(tree->bottom) ? + ACS_DARROW | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D) : + ' '| COLOR_PAIR(GNT_COLOR_NORMAL)); + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); while (start < widget->priv.height - pos) { mvwhline(widget->window, start, pos, ' ', - widget->priv.width - pos * 2); + widget->priv.width - pos * 2 - 1); tree_mark_columns(tree, pos, start, ACS_VLINE); start++; }