comparison console/libgnt/gntcolors.c @ 14299:ea5193c23171

[gaim-migrate @ 16989] Now the customcolors should work. Apparently I didn't include it in last commit. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 23 Aug 2006 01:35:44 +0000
parents e7de1f6d9f35
children 9df5dd999402
comparison
equal deleted inserted replaced
14298:6e2e9e84b99d 14299:ea5193c23171
1 #include <ncursesw/ncurses.h> 1 #include <ncursesw/ncurses.h>
2 #include "gntcolors.h" 2 #include "gntcolors.h"
3 #include "gntstyle.h"
3 4
4 #include <glib.h> 5 #include <glib.h>
5 6
6 #include <stdlib.h> 7 #include <stdlib.h>
7 #include <string.h> 8 #include <string.h>
34 } 35 }
35 36
36 void gnt_init_colors() 37 void gnt_init_colors()
37 { 38 {
38 start_color(); 39 start_color();
39 if (can_change_color()) 40 if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color())
40 { 41 {
41 backup_colors(); 42 backup_colors();
42 43
43 /* Do some init_color()s */ 44 /* Do some init_color()s */
44 init_color(GNT_COLOR_BLACK, 0, 0, 0); 45 init_color(GNT_COLOR_BLACK, 0, 0, 0);
61 init_pair(GNT_COLOR_HIGHLIGHT_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY); 62 init_pair(GNT_COLOR_HIGHLIGHT_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY);
62 init_pair(GNT_COLOR_DISABLED, GNT_COLOR_GRAY, GNT_COLOR_WHITE); 63 init_pair(GNT_COLOR_DISABLED, GNT_COLOR_GRAY, GNT_COLOR_WHITE);
63 } 64 }
64 else 65 else
65 { 66 {
67 use_default_colors();
66 init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); 68 init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE);
67 init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); 69 init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE);
68 init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); 70 init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK);
69 init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLUE); 71 init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLUE);
70 init_pair(GNT_COLOR_TITLE_D, COLOR_WHITE, COLOR_BLACK); 72 init_pair(GNT_COLOR_TITLE_D, COLOR_WHITE, COLOR_BLACK);
75 } 77 }
76 78
77 void 79 void
78 gnt_uninit_colors() 80 gnt_uninit_colors()
79 { 81 {
80 restore_colors(); 82 if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color())
83 restore_colors();
81 } 84 }
82 85
83 static int 86 static int
84 get_color(char *key) 87 get_color(char *key)
85 { 88 {