# HG changeset patch # User Sadrul Habib Chowdhury # Date 1156296944 0 # Node ID ea5193c23171096ac4a4bea960ddf9b31fd51534 # Parent 6e2e9e84b99d7e66f80175bb7b87d9d843d29027 [gaim-migrate @ 16989] Now the customcolors should work. Apparently I didn't include it in last commit. committer: Tailor Script diff -r 6e2e9e84b99d -r ea5193c23171 console/libgnt/gntcolors.c --- a/console/libgnt/gntcolors.c Wed Aug 23 01:09:33 2006 +0000 +++ b/console/libgnt/gntcolors.c Wed Aug 23 01:35:44 2006 +0000 @@ -1,5 +1,6 @@ #include #include "gntcolors.h" +#include "gntstyle.h" #include @@ -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 diff -r 6e2e9e84b99d -r ea5193c23171 console/libgnt/gntmain.c --- a/console/libgnt/gntmain.c Wed Aug 23 01:09:33 2006 +0000 +++ b/console/libgnt/gntmain.c Wed Aug 23 01:35:44 2006 +0000 @@ -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); diff -r 6e2e9e84b99d -r ea5193c23171 console/libgnt/gntstyle.c --- a/console/libgnt/gntstyle.c Wed Aug 23 01:09:33 2006 +0000 +++ b/console/libgnt/gntstyle.c Wed Aug 23 01:35:44 2006 +0000 @@ -141,6 +141,7 @@ const char *style; GntStyle en; } styles[] = {{"shadow", GNT_STYLE_SHADOW}, + {"customcolor", GNT_STYLE_COLOR}, {NULL, 0}}; if (error) diff -r 6e2e9e84b99d -r ea5193c23171 console/libgnt/gntstyle.h --- a/console/libgnt/gntstyle.h Wed Aug 23 01:09:33 2006 +0000 +++ b/console/libgnt/gntstyle.h Wed Aug 23 01:35:44 2006 +0000 @@ -3,6 +3,7 @@ typedef enum { GNT_STYLE_SHADOW = 0, + GNT_STYLE_COLOR = 1, GNT_STYLES } GntStyle;