Mercurial > pidgin.yaz
changeset 13854:a4c30c1d9de8
[gaim-migrate @ 16313]
Unnecessary variables are bad, mmkay.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 23 Jun 2006 00:57:30 +0000 |
parents | bbf0470cb348 |
children | 5b288502a382 |
files | console/libgnt/gntbox.c console/libgnt/gnttree.c console/libgnt/gnttree.h |
diffstat | 3 files changed, 12 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/console/libgnt/gntbox.c Fri Jun 23 00:45:45 2006 +0000 +++ b/console/libgnt/gntbox.c Fri Jun 23 00:57:30 2006 +0000 @@ -50,7 +50,6 @@ GntBox *box = GNT_BOX(widget); int w, h, curx, cury, max; gboolean has_border = FALSE; - int x, y; w = h = 0; max = -1;
--- a/console/libgnt/gnttree.c Fri Jun 23 00:45:45 2006 +0000 +++ b/console/libgnt/gnttree.c Fri Jun 23 00:57:30 2006 +0000 @@ -34,7 +34,7 @@ else pos = 1; - wbkgd(tree->scroll, COLOR_PAIR(GNT_COLOR_NORMAL)); + wbkgd(widget->window, COLOR_PAIR(GNT_COLOR_NORMAL)); for (start = tree->top, iter = g_list_nth(tree->list, tree->top); iter && start < tree->bottom; start++, iter = iter->next) @@ -57,18 +57,18 @@ if (start == tree->current) { - wbkgdset(tree->scroll, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); - mvwprintw(tree->scroll, start - tree->top + pos, pos, str); - wbkgdset(tree->scroll, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); + mvwprintw(widget->window, start - tree->top + pos, pos, str); + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); } else - mvwprintw(tree->scroll, start - tree->top + pos, pos, str); + mvwprintw(widget->window, start - tree->top + pos, pos, str); } while (start < tree->bottom) { - wmove(tree->scroll, start - tree->top + pos, pos); - wclrtoeol(tree->scroll); + wmove(widget->window, start - tree->top + pos, pos); + wclrtoeol(widget->window); start++; } @@ -80,21 +80,12 @@ { GntTree *tree = GNT_TREE(widget); - /* For the Tree (or anything that scrolls), we will create a 'hidden' window - * of 'large enough' size. We never wrefresh that hidden-window, instead we - * just copy stuff from it into the visible window */ + scrollok(widget->window, TRUE); + wsetscrreg(widget->window, 0, widget->priv.height - 1); - if (tree->scroll == NULL) - { - tree->scroll = widget->window; /* newwin(SCROLL_HEIGHT, widget->priv.width, 0, 0); */ - scrollok(tree->scroll, TRUE); - /*wsetscrreg(tree->scroll, 0, SCROLL_HEIGHT - 1);*/ - wsetscrreg(tree->scroll, 0, widget->priv.height - 1); - - tree->top = 0; - tree->bottom = widget->priv.height - - (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER) ? 0 : 2); - } + tree->top = 0; + tree->bottom = widget->priv.height - + (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER) ? 0 : 2); redraw_tree(tree);