From: <sa...@us...> - 2006-08-23 01:35:54
|
Revision: 16989 Author: sadrul Date: 2006-08-22 18:35:44 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16989&view=rev Log Message: ----------- Now the customcolors should work. Apparently I didn't include it in last commit. Modified Paths: -------------- trunk/console/libgnt/gntcolors.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntstyle.c trunk/console/libgnt/gntstyle.h Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntcolors.c 2006-08-23 01:35:44 UTC (rev 16989) @@ -1,5 +1,6 @@ #include <ncursesw/ncurses.h> #include "gntcolors.h" +#include "gntstyle.h" #include <glib.h> @@ -36,7 +37,7 @@ void gnt_init_colors() { start_color(); - if (can_change_color()) + if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color()) { backup_colors(); @@ -63,6 +64,7 @@ } else { + use_default_colors(); init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); @@ -77,7 +79,8 @@ void gnt_uninit_colors() { - restore_colors(); + if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color()) + restore_colors(); } static int Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntmain.c 2006-08-23 01:35:44 UTC (rev 16989) @@ -782,13 +782,13 @@ noecho(); curs_set(0); - gnt_init_colors(); gnt_init_styles(); filename = g_build_filename(g_get_home_dir(), ".gntrc", NULL); gnt_style_read_configure_file(filename); g_free(filename); + gnt_init_colors(); X_MIN = 0; Y_MIN = 0; X_MAX = getmaxx(stdscr); Modified: trunk/console/libgnt/gntstyle.c =================================================================== --- trunk/console/libgnt/gntstyle.c 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntstyle.c 2006-08-23 01:35:44 UTC (rev 16989) @@ -141,6 +141,7 @@ const char *style; GntStyle en; } styles[] = {{"shadow", GNT_STYLE_SHADOW}, + {"customcolor", GNT_STYLE_COLOR}, {NULL, 0}}; if (error) Modified: trunk/console/libgnt/gntstyle.h =================================================================== --- trunk/console/libgnt/gntstyle.h 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntstyle.h 2006-08-23 01:35:44 UTC (rev 16989) @@ -3,6 +3,7 @@ typedef enum { GNT_STYLE_SHADOW = 0, + GNT_STYLE_COLOR = 1, GNT_STYLES } GntStyle; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |