From: <sa...@us...> - 2006-08-31 03:14:05
|
Revision: 17093 http://svn.sourceforge.net/gaim/?rev=17093&view=rev Author: sadrul Date: 2006-08-30 20:13:54 -0700 (Wed, 30 Aug 2006) Log Message: ----------- 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. Modified Paths: -------------- trunk/console/libgnt/gntcolors.c trunk/console/libgnt/gntcolors.h trunk/console/libgnt/gntmain.c Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-08-31 03:12:07 UTC (rev 17092) +++ trunk/console/libgnt/gntcolors.c 2006-08-31 03:13:54 UTC (rev 17093) @@ -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); - } - else - { + bg = -1; + } else { init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); - init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE); + bg = 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; Modified: trunk/console/libgnt/gntcolors.h =================================================================== --- trunk/console/libgnt/gntcolors.h 2006-08-31 03:12:07 UTC (rev 17092) +++ trunk/console/libgnt/gntcolors.h 2006-08-31 03:13:54 UTC (rev 17093) @@ -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; Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-31 03:12:07 UTC (rev 17092) +++ trunk/console/libgnt/gntmain.c 2006-08-31 03:13:54 UTC (rev 17093) @@ -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)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |