# HG changeset patch # User Sadrul Habib Chowdhury # Date 1156994034 0 # Node ID 39b0124a455ddd0210380bbc1537fc83ba4df428 # Parent 8a213dc761dd36d0be8e0de7ca56302afe020c13 [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 diff -r 8a213dc761dd -r 39b0124a455d console/libgnt/gntcolors.c --- 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; diff -r 8a213dc761dd -r 39b0124a455d console/libgnt/gntcolors.h --- 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; diff -r 8a213dc761dd -r 39b0124a455d console/libgnt/gntmain.c --- 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));