From 45a26b111f8bdfe9fb534368eb29bb8963353d8a Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 22 Nov 2012 02:34:49 +0000 Subject: [PATCH] Added time to themes, and some example themes --- src/theme.c | 5 +++++ src/theme.h | 1 + src/windows.c | 6 ++++++ themes/aqua | 27 +++++++++++++++++++++++++++ themes/hacker | 27 +++++++++++++++++++++++++++ themes/headache | 27 +++++++++++++++++++++++++++ themes/original | 27 +++++++++++++++++++++++++++ themes/redsplash | 2 ++ themes/whiteness | 27 +++++++++++++++++++++++++++ themes/yellowsplash | 2 ++ 10 files changed, 151 insertions(+) create mode 100644 themes/aqua create mode 100644 themes/hacker create mode 100644 themes/headache create mode 100644 themes/original create mode 100644 themes/redsplash create mode 100644 themes/whiteness create mode 100644 themes/yellowsplash diff --git a/src/theme.c b/src/theme.c index b6e18afa..aafbd859 100644 --- a/src/theme.c +++ b/src/theme.c @@ -70,6 +70,7 @@ static struct colours_t { NCURSES_COLOR_T statusbarnew; NCURSES_COLOR_T maintext; NCURSES_COLOR_T inputtext; + NCURSES_COLOR_T timetext; NCURSES_COLOR_T splashtext; NCURSES_COLOR_T online; NCURSES_COLOR_T away; @@ -158,6 +159,7 @@ theme_init_colours(void) init_pair(3, colour_prefs.error, colour_prefs.bkgnd); init_pair(4, colour_prefs.incoming, colour_prefs.bkgnd); init_pair(5, colour_prefs.inputtext, colour_prefs.bkgnd); + init_pair(6, colour_prefs.timetext, colour_prefs.bkgnd); // title bar init_pair(10, colour_prefs.titlebartext, colour_prefs.titlebar); @@ -257,6 +259,9 @@ _load_colours(void) gchar *inputtext_val = g_key_file_get_string(theme, "colours", "inputtext", NULL); _set_colour(inputtext_val, &colour_prefs.inputtext, COLOR_WHITE); + gchar *timetext_val = g_key_file_get_string(theme, "colours", "timetext", NULL); + _set_colour(timetext_val, &colour_prefs.timetext, COLOR_WHITE); + gchar *online_val = g_key_file_get_string(theme, "colours", "online", NULL); _set_colour(online_val, &colour_prefs.online, COLOR_GREEN); diff --git a/src/theme.h b/src/theme.h index 459135d6..ca1c2245 100644 --- a/src/theme.h +++ b/src/theme.h @@ -39,6 +39,7 @@ #define COLOUR_ERROR COLOR_PAIR(3) #define COLOUR_INCOMING COLOR_PAIR(4) #define COLOUR_INPUT_TEXT COLOR_PAIR(5) +#define COLOUR_TIME COLOR_PAIR(6) #define COLOUR_TITLE_TEXT COLOR_PAIR(10) #define COLOUR_TITLE_BRACKET COLOR_PAIR(11) #define COLOUR_STATUS_TEXT COLOR_PAIR(20) diff --git a/src/windows.c b/src/windows.c index 27c73cb4..e87109c8 100644 --- a/src/windows.c +++ b/src/windows.c @@ -393,7 +393,9 @@ win_show_incomming_msg(const char * const from, const char * const message, } else { GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp); gchar *date_fmt = g_date_time_format(time, "%H:%M:%S"); + wattron(win, COLOUR_TIME); wprintw(win, "%s - ", date_fmt); + wattroff(win, COLOUR_TIME); g_date_time_unref(time); g_free(date_fmt); } @@ -430,7 +432,9 @@ win_show_incomming_msg(const char * const from, const char * const message, } else { GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp); gchar *date_fmt = g_date_time_format(time, "%H:%M:%S"); + wattron(win, COLOUR_TIME); wprintw(win, "%s - ", date_fmt); + wattroff(win, COLOUR_TIME); g_date_time_unref(time); g_free(date_fmt); } @@ -1521,7 +1525,9 @@ _win_show_time(WINDOW *win) { GDateTime *time = g_date_time_new_now_local(); gchar *date_fmt = g_date_time_format(time, "%H:%M:%S"); + wattron(win, COLOUR_TIME); wprintw(win, "%s - ", date_fmt); + wattroff(win, COLOUR_TIME); g_date_time_unref(time); g_free(date_fmt); } diff --git a/themes/aqua b/themes/aqua new file mode 100644 index 00000000..a96ae9e8 --- /dev/null +++ b/themes/aqua @@ -0,0 +1,27 @@ +[colours] +bkgnd=default +titlebar=blue +statusbar=blue +titlebartext=white +titlebarbrackets=white +statusbartext=white +statusbarbrackets=white +statusbaractive=cyan +statusbarnew=white +maintext=blue +inputtext=white +timetext=cyan +splashtext=white +online=white +away=cyan +chat=white +dnd=blue +xa=cyan +offline=blue +typing=white +gone=blue +error=white +incoming=white +roominfo=white +me=white +them=cyan diff --git a/themes/hacker b/themes/hacker new file mode 100644 index 00000000..fc38c529 --- /dev/null +++ b/themes/hacker @@ -0,0 +1,27 @@ +[colours] +bkgnd=default +titlebar=green +statusbar=green +titlebartext=black +titlebarbrackets=black +statusbartext=black +statusbarbrackets=black +statusbaractive=black +statusbarnew=black +maintext=green +inputtext=green +timetext=green +splashtext=green +online=green +away=green +chat=green +dnd=green +xa=green +offline=green +typing=green +gone=green +error=red +incoming=green +roominfo=green +me=green +them=green diff --git a/themes/headache b/themes/headache new file mode 100644 index 00000000..350b589a --- /dev/null +++ b/themes/headache @@ -0,0 +1,27 @@ +[colours] +bkgnd=default +titlebar=magenta +statusbar=default +titlebartext=white +titlebarbrackets=white +statusbartext=white +statusbarbrackets=red +statusbaractive=cyan +statusbarnew=white +maintext=blue +inputtext=yellow +timetext=green +splashtext=red +online=red +away=cyan +chat=green +dnd=megenta +xa=cyan +offline=green +typing=magenta +gone=yellow +error=red +incoming=yellow +roominfo=white +me=white +them=white diff --git a/themes/original b/themes/original new file mode 100644 index 00000000..7c401040 --- /dev/null +++ b/themes/original @@ -0,0 +1,27 @@ +[colours] +bkgnd=default +titlebar=blue +statusbar=blue +titlebartext=white +titlebarbrackets=cyan +statusbartext=white +statusbarbrackets=cyan +statusbaractive=cyan +statusbarnew=white +maintext=white +inputtext=white +timetext=white +splashtext=cyan +online=green +away=cyan +chat=green +dnd=red +xa=cyan +offline=red +typing=yellow +gone=red +error=red +incoming=yellow +roominfo=yellow +me=yellow +them=green diff --git a/themes/redsplash b/themes/redsplash new file mode 100644 index 00000000..6c6a5999 --- /dev/null +++ b/themes/redsplash @@ -0,0 +1,2 @@ +[colours] +splashtext=red diff --git a/themes/whiteness b/themes/whiteness new file mode 100644 index 00000000..0795cdf6 --- /dev/null +++ b/themes/whiteness @@ -0,0 +1,27 @@ +[colours] +bkgnd=white +titlebar=blue +statusbar=blue +titlebartext=white +titlebarbrackets=white +statusbartext=white +statusbarbrackets=white +statusbaractive=megenta +statusbarnew=red +maintext=black +inputtext=black +timetext=black +splashtext=black +online=green +away=cyan +chat=green +dnd=red +xa=cyan +offline=red +typing=yellow +gone=red +error=red +incoming=yellow +roominfo=yellow +me=yellow +them=green diff --git a/themes/yellowsplash b/themes/yellowsplash new file mode 100644 index 00000000..46510a06 --- /dev/null +++ b/themes/yellowsplash @@ -0,0 +1,2 @@ +[colours] +splashtext=yellow