Mercurial > pidgin.yaz
comparison console/libgnt/gntcolors.c @ 14302:a8632e4bd849
[gaim-migrate @ 16992]
Use default terminal colors if available
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Wed, 23 Aug 2006 03:00:10 +0000 |
parents | 9df5dd999402 |
children | 985e5e3f6f2c |
comparison
equal
deleted
inserted
replaced
14301:9df5dd999402 | 14302:a8632e4bd849 |
---|---|
41 } | 41 } |
42 | 42 |
43 void gnt_init_colors() | 43 void gnt_init_colors() |
44 { | 44 { |
45 static gboolean init = FALSE; | 45 static gboolean init = FALSE; |
46 int defaults; | |
46 | 47 |
47 if (init) | 48 if (init) |
48 return; | 49 return; |
49 init = TRUE; | 50 init = TRUE; |
50 | 51 |
51 start_color(); | 52 start_color(); |
52 use_default_colors(); | 53 defaults = use_default_colors(); |
53 | 54 |
54 if (can_use_custom_color()) | 55 if (can_use_custom_color()) |
55 { | 56 { |
56 backup_colors(); | 57 backup_colors(); |
57 | 58 |
76 init_pair(GNT_COLOR_HIGHLIGHT_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY); | 77 init_pair(GNT_COLOR_HIGHLIGHT_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY); |
77 init_pair(GNT_COLOR_DISABLED, GNT_COLOR_GRAY, GNT_COLOR_WHITE); | 78 init_pair(GNT_COLOR_DISABLED, GNT_COLOR_GRAY, GNT_COLOR_WHITE); |
78 } | 79 } |
79 else | 80 else |
80 { | 81 { |
81 init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); | 82 if (defaults == OK) |
83 { | |
84 init_pair(GNT_COLOR_NORMAL, -1, -1); | |
85 init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, -1); | |
86 } | |
87 else | |
88 { | |
89 init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); | |
90 init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE); | |
91 } | |
82 init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); | 92 init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); |
83 init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); | 93 init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); |
84 init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLUE); | 94 init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLUE); |
85 init_pair(GNT_COLOR_TITLE_D, COLOR_WHITE, COLOR_BLACK); | 95 init_pair(GNT_COLOR_TITLE_D, COLOR_WHITE, COLOR_BLACK); |
86 init_pair(GNT_COLOR_TEXT_NORMAL, COLOR_WHITE, COLOR_BLUE); | 96 init_pair(GNT_COLOR_TEXT_NORMAL, COLOR_WHITE, COLOR_BLUE); |
87 init_pair(GNT_COLOR_HIGHLIGHT_D, COLOR_CYAN, COLOR_BLACK); | 97 init_pair(GNT_COLOR_HIGHLIGHT_D, COLOR_CYAN, COLOR_BLACK); |
88 init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE); | |
89 } | 98 } |
90 } | 99 } |
91 | 100 |
92 void | 101 void |
93 gnt_uninit_colors() | 102 gnt_uninit_colors() |