changeset 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 d9aa45c10588
files console/libgnt/gntcolors.c
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/console/libgnt/gntcolors.c	Wed Aug 23 02:34:40 2006 +0000
+++ b/console/libgnt/gntcolors.c	Wed Aug 23 03:00:10 2006 +0000
@@ -43,13 +43,14 @@
 void gnt_init_colors()
 {
 	static gboolean init = FALSE;
+	int defaults;
 
 	if (init)
 		return;
 	init = TRUE;
 
 	start_color();
-	use_default_colors();
+	defaults = use_default_colors();
 
 	if (can_use_custom_color())
 	{
@@ -78,14 +79,22 @@
 	}
 	else
 	{
-		init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE);
+		if (defaults == OK)
+		{
+			init_pair(GNT_COLOR_NORMAL, -1, -1);
+			init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, -1);
+		}
+		else
+		{
+			init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE);
+			init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE);
+		}
 		init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE);
 		init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK);
 		init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLUE);
 		init_pair(GNT_COLOR_TITLE_D, COLOR_WHITE, COLOR_BLACK);
 		init_pair(GNT_COLOR_TEXT_NORMAL, COLOR_WHITE, COLOR_BLUE);
 		init_pair(GNT_COLOR_HIGHLIGHT_D, COLOR_CYAN, COLOR_BLACK);
-		init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE);
 	}
 }