From: <sa...@us...> - 2006-06-23 00:57:36
|
Revision: 16313 Author: sadrul Date: 2006-06-22 17:57:30 -0700 (Thu, 22 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16313&view=rev Log Message: ----------- Unnecessary variables are bad, mmkay. Modified Paths: -------------- trunk/console/libgnt/gntbox.c trunk/console/libgnt/gnttree.c trunk/console/libgnt/gnttree.h Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-06-23 00:45:45 UTC (rev 16312) +++ trunk/console/libgnt/gntbox.c 2006-06-23 00:57:30 UTC (rev 16313) @@ -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; Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-06-23 00:45:45 UTC (rev 16312) +++ trunk/console/libgnt/gnttree.c 2006-06-23 00:57:30 UTC (rev 16313) @@ -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,22 +80,13 @@ { 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); DEBUG; Modified: trunk/console/libgnt/gnttree.h =================================================================== --- trunk/console/libgnt/gnttree.h 2006-06-23 00:45:45 UTC (rev 16312) +++ trunk/console/libgnt/gnttree.h 2006-06-23 00:57:30 UTC (rev 16313) @@ -27,8 +27,6 @@ { GntWidget parent; - WINDOW *scroll; - int current; /* current selection */ int top; /* The index in 'list' of the topmost visible item */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |