about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-07-03 23:44:51 +0100
committerJames Booth <boothj5@gmail.com>2013-07-03 23:44:51 +0100
commit581c1e8b951d7b9841cec56d5ebf9d3c138e6ce9 (patch)
tree45645cc4fa432bc48be631aa6782469abadc4269 /src/config
parent817857e4c0d986226b7c213debca9de4f32e979a (diff)
downloadprofani-tty-581c1e8b951d7b9841cec56d5ebf9d3c138e6ce9.tar.gz
Coloured contact and subscription in /roster and /group output
Diffstat (limited to 'src/config')
-rw-r--r--src/config/theme.c14
-rw-r--r--src/config/theme.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/src/config/theme.c b/src/config/theme.c
index 5ca19969..1c0d176a 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -72,6 +72,8 @@ static struct colours_t {
         NCURSES_COLOR_T inputtext;
         NCURSES_COLOR_T timetext;
         NCURSES_COLOR_T splashtext;
+        NCURSES_COLOR_T subscribed;
+        NCURSES_COLOR_T unsubscribed;
         NCURSES_COLOR_T online;
         NCURSES_COLOR_T away;
         NCURSES_COLOR_T xa;
@@ -220,6 +222,10 @@ theme_init_colours(void)
     // states
     init_pair(60, colour_prefs.typing, colour_prefs.bkgnd);
     init_pair(61, colour_prefs.gone, colour_prefs.bkgnd);
+
+    // subscription status
+    init_pair(70, colour_prefs.subscribed, colour_prefs.bkgnd);
+    init_pair(71, colour_prefs.unsubscribed, colour_prefs.bkgnd);
 }
 
 static NCURSES_COLOR_T
@@ -306,6 +312,14 @@ _load_colours(void)
     _set_colour(timetext_val, &colour_prefs.timetext, COLOR_WHITE);
     g_free(timetext_val);
 
+    gchar *subscribed_val = g_key_file_get_string(theme, "colours", "subscribed", NULL);
+    _set_colour(subscribed_val, &colour_prefs.subscribed, COLOR_GREEN);
+    g_free(subscribed_val);
+
+    gchar *unsubscribed_val = g_key_file_get_string(theme, "colours", "unsubscribed", NULL);
+    _set_colour(unsubscribed_val, &colour_prefs.unsubscribed, COLOR_RED);
+    g_free(unsubscribed_val);
+
     gchar *online_val = g_key_file_get_string(theme, "colours", "online", NULL);
     _set_colour(online_val, &colour_prefs.online, COLOR_GREEN);
     g_free(online_val);
diff --git a/src/config/theme.h b/src/config/theme.h
index d87b69f2..8878d7b2 100644
--- a/src/config/theme.h
+++ b/src/config/theme.h
@@ -55,6 +55,8 @@
 #define COLOUR_XA               COLOR_PAIR(55)
 #define COLOUR_TYPING           COLOR_PAIR(60)
 #define COLOUR_GONE             COLOR_PAIR(61)
+#define COLOUR_SUBSCRIBED       COLOR_PAIR(70)
+#define COLOUR_UNSUBSCRIBED     COLOR_PAIR(71)
 
 void theme_init(const char * const theme_name);
 void theme_init_colours(void);