changeset 14387:39b0124a455d

[gaim-migrate @ 17093] Allow different colors for highlighted windows. The name of the pair is "urgent" if you want to change it from ~/.gntrc. The default is green on the active background (or white). Red doesn't look too bad either. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 31 Aug 2006 03:13:54 +0000
parents 8a213dc761dd
children f4af666fafe3
files console/libgnt/gntcolors.c console/libgnt/gntcolors.h console/libgnt/gntmain.c
diffstat 3 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/console/libgnt/gntcolors.c	Thu Aug 31 03:12:07 2006 +0000
+++ b/console/libgnt/gntcolors.c	Thu Aug 31 03:13:54 2006 +0000
@@ -81,19 +81,22 @@
 		init_pair(GNT_COLOR_TEXT_NORMAL, GNT_COLOR_WHITE, GNT_COLOR_BLUE);
 		init_pair(GNT_COLOR_HIGHLIGHT_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY);
 		init_pair(GNT_COLOR_DISABLED, GNT_COLOR_GRAY, GNT_COLOR_WHITE);
+		init_pair(GNT_COLOR_URGENT, GNT_COLOR_WHITE, GNT_COLOR_RED);
 	}
 	else
 	{
-		if (defaults == OK)
-		{
+		int bg;
+
+		if (defaults == OK) {
 			init_pair(GNT_COLOR_NORMAL, -1, -1);
-			init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, -1);
+			bg = -1;
+		} else {
+			init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE);
+			bg = COLOR_WHITE;
 		}
-		else
-		{
-			init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE);
-			init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE);
-		}
+		init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, bg);
+		init_pair(GNT_COLOR_URGENT, COLOR_GREEN, bg);
+
 		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);
@@ -231,6 +234,8 @@
 				type = GNT_COLOR_TEXT_NORMAL;
 			else if (strcmp(key, "disabled") == 0)
 				type = GNT_COLOR_DISABLED;
+			else if (strcmp(key, "urgent") == 0)
+				type = GNT_COLOR_URGENT;
 			else
 				continue;
 
--- a/console/libgnt/gntcolors.h	Thu Aug 31 03:12:07 2006 +0000
+++ b/console/libgnt/gntcolors.h	Thu Aug 31 03:13:54 2006 +0000
@@ -16,6 +16,7 @@
 	GNT_COLOR_SHADOW,
 	GNT_COLOR_TITLE,
 	GNT_COLOR_TITLE_D,
+	GNT_COLOR_URGENT,       /* this is for the 'urgent' windows */
 	GNT_COLORS
 } GntColorType;
 
--- a/console/libgnt/gntmain.c	Thu Aug 31 03:12:07 2006 +0000
+++ b/console/libgnt/gntmain.c	Thu Aug 31 03:13:54 2006 +0000
@@ -225,19 +225,14 @@
 		int color;
 		const char *title;
 
-		if (w == ordered->data)
-		{
+		if (w == ordered->data) {
 			/* This is the current window in focus */
 			color = GNT_COLOR_TITLE;
 			GNT_WIDGET_UNSET_FLAGS(w, GNT_WIDGET_URGENT);
-		}
-		else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT))
-		{
+		} else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT)) {
 			/* This is a window with the URGENT hint set */
-			color = GNT_COLOR_TITLE_D;
-		}
-		else
-		{
+			color = GNT_COLOR_URGENT;
+		} else {
 			color = GNT_COLOR_NORMAL;
 		}
 		wbkgdset(taskbar, '\0' | COLOR_PAIR(color));