From: <sa...@us...> - 2006-08-14 02:17:04
|
Revision: 16741 Author: sadrul Date: 2006-08-13 19:16:58 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16741&view=rev Log Message: ----------- Show little scroll-arrows for trees and textviews when appropriate. Modified Paths: -------------- trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-14 00:08:15 UTC (rev 16740) +++ trunk/console/libgnt/gntmain.c 2006-08-14 02:16:58 UTC (rev 16741) @@ -399,6 +399,10 @@ case 'j': case 'n': ch = '+'; break; + case '-': + ch = '^'; break; + case '.': + ch = 'v'; break; default: ch = ' '; break; } Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-08-14 00:08:15 UTC (rev 16740) +++ trunk/console/libgnt/gnttextview.c 2006-08-14 02:16:58 UTC (rev 16741) @@ -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; } Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-08-14 00:08:15 UTC (rev 16740) +++ trunk/console/libgnt/gnttree.c 2006-08-14 02:16:58 UTC (rev 16741) @@ -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++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |