# HG changeset patch # User Sadrul Habib Chowdhury # Date 1155521818 0 # Node ID c0ee28af3ca2342cc41be71e42955723fba11d3d # Parent a82d407d38fad5f159be0c752288ab0a10e34d34 [gaim-migrate @ 16741] Show little scroll-arrows for trees and textviews when appropriate. committer: Tailor Script diff -r a82d407d38fa -r c0ee28af3ca2 console/libgnt/gntmain.c --- 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; } diff -r a82d407d38fa -r c0ee28af3ca2 console/libgnt/gnttextview.c --- 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; } diff -r a82d407d38fa -r c0ee28af3ca2 console/libgnt/gnttree.c --- 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++; }