]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
gui: Simplify color handling.
authorAndre Noll <maan@systemlinux.org>
Sat, 8 Mar 2014 20:18:21 +0000 (21:18 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 4 May 2014 13:53:20 +0000 (15:53 +0200)
Various gui elements of para_gui can be customized through struct
gui_theme. Currently this structure contains two integers for each
each element, one for the foreground and one for the background color
of the element. This is a bit clumsy and repetitive.

This commit cuts down the number of fields of struct gui_theme by
a factor of two by introducing struct gui_color_spec as a pair of
integers.

The patch is quite large but also simple.

gui.c
gui.h
gui_theme.c

diff --git a/gui.c b/gui.c
index 57ee8be5e9e9f2867f8c85ecdcce7aca2b4656a0..c5adddb2fa002e92ba9368e99355e695102bf0de 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -686,7 +686,7 @@ static void init_wins(int top_lines)
        int bot_lines = LINES - top_lines - 3, sb_lines = 1, in_lines = 1,
                sep_lines = 1;
 
-       assume_default_colors(theme.default_fg, theme.default_bg);
+       assume_default_colors(theme.dflt.fg, theme.dflt.bg);
        if (top.win) {
                wresize(top.win, top_lines, COLS);
                mvwin(top.win, top_y, 0);
@@ -758,16 +758,16 @@ static void init_colors_or_die(void)
                die(EXIT_FAILURE, "fatal: failed to start colors\n");
        FOR_EACH_STATUS_ITEM(i)
                if (theme.data[i].len)
-                       init_pair_or_die(i + 1, theme.data[i].fg,
-                               theme.data[i].bg);
-       init_pair_or_die(COLOR_STATUSBAR, theme.sb_fg, theme.sb_bg);
-       init_pair_or_die(COLOR_COMMAND, theme.cmd_fg, theme.cmd_bg);
-       init_pair_or_die(COLOR_OUTPUT, theme.output_fg, theme.output_bg);
-       init_pair_or_die(COLOR_MSG, theme.msg_fg, theme.msg_bg);
-       init_pair_or_die(COLOR_ERRMSG, theme.err_msg_fg, theme.err_msg_bg);
-       init_pair_or_die(COLOR_SEPARATOR, theme.sep_fg, theme.sep_bg);
-       init_pair_or_die(COLOR_TOP, theme.default_fg, theme.default_bg);
-       init_pair_or_die(COLOR_BOT, theme.default_fg, theme.default_bg);
+                       init_pair_or_die(i + 1, theme.data[i].color.fg,
+                               theme.data[i].color.bg);
+       init_pair_or_die(COLOR_STATUSBAR, theme.sb.fg, theme.sb.bg);
+       init_pair_or_die(COLOR_COMMAND, theme.cmd.fg, theme.cmd.bg);
+       init_pair_or_die(COLOR_OUTPUT, theme.output.fg, theme.output.bg);
+       init_pair_or_die(COLOR_MSG, theme.msg.fg, theme.msg.bg);
+       init_pair_or_die(COLOR_ERRMSG, theme.err_msg.fg, theme.err_msg.bg);
+       init_pair_or_die(COLOR_SEPARATOR, theme.sep.fg, theme.sep.bg);
+       init_pair_or_die(COLOR_TOP, theme.dflt.fg, theme.dflt.bg);
+       init_pair_or_die(COLOR_BOT, theme.dflt.fg, theme.dflt.bg);
 }
 
 /* (Re-)initialize the curses library. */
diff --git a/gui.h b/gui.h
index eabfd3c7ed2d7de6ed801510af93384fc654032b..8a469346af4e56d9610ff636770692468af2310c 100644 (file)
--- a/gui.h
+++ b/gui.h
@@ -6,6 +6,15 @@
 
 /** \file gui.h symbols used by gui and gui_theme */
 
+/**
+ * The foreground and background color of each status item, the decorations and
+ * all messages can be customized through an instance of this structure.
+ */
+struct gui_color_spec {
+       int fg; /**< Foreground color. */
+       int bg; /**< Background color. */
+};
+
 /** How to display one status item. */
 struct stat_item_data {
        const char *prefix; /**< Text to print before the item content. */
@@ -13,8 +22,7 @@ struct stat_item_data {
        unsigned x; /**< Horizontal start coordinate for this item. */
        unsigned y; /**< Vertical start coordinate for this item. */
        unsigned len; /**< Item width, including \a prefix and \a postfix. */
-       int fg; /**< Foreground color. */
-       int bg; /**< Background color. */
+       struct gui_color_spec color; /**< Foreground and background color. */
        int align; /**< How to align this item. */
 };
 
@@ -24,36 +32,10 @@ struct gui_theme {
        const char *name;
        /** Also printed at startup. */
        const char *author;
-       /** Foreground color of the status bar. */
-       int sb_fg;
-       /** Background color of the status bar. */
-       int sb_bg;
-       /** Foreground for the name and args of the executing process. */
-       int cmd_fg;
-       /** Background for the name and args of the executing process. */
-       int cmd_bg;
-       /** Foreground color for stdout of the executing process. */
-       int output_fg;
-       /** Background color for stdout of the executing process. */
-       int output_bg;
-       /** Foreground color for log messages of moderate severity. */
-       int msg_fg;
-       /** Background color for log messages of moderate severity. */
-       int msg_bg;
-       /** Foreground color for severe log messages. */
-       int err_msg_fg;
-       /** Background color for severe log messages. */
-       int err_msg_bg;
-       /** Foreground color for the separator line. */
-       int sep_fg;
-       /** Background color for the separator line. */
-       int sep_bg;
        /** The character for the separator line. */
        char sep_char;
-       /** Default foreground color, see assume_default_colors(3). */
-       int default_fg;
-       /** Default background color. */
-       int default_bg;
+       /** Default color, see assume_default_colors(3). */
+       struct gui_color_spec dflt;
        /** Default number of lines of the top window. */
        int top_lines_default;
        /** Minimal admissible number of lines to display the top window. */
@@ -64,6 +46,18 @@ struct gui_theme {
        int cols_min;
        /** Individual status item properties. */
        struct stat_item_data data[NUM_STAT_ITEMS];
+       /** Color of the status bar. */
+       struct gui_color_spec sb;
+       /** Color of the name and args of the executing process. */
+       struct gui_color_spec cmd;
+       /** Color for stdout of the executing process. */
+       struct gui_color_spec output;
+       /** Color for log messages of moderate severity. */
+       struct gui_color_spec msg;
+       /** Color for severe log messages. */
+       struct gui_color_spec err_msg;
+       /** Color for the separator line. */
+       struct gui_color_spec sep;
 };
 
 void theme_init(const char *name, struct gui_theme *t);
index b13fdf9f13e3cbc13a19d051f86d09ca9610fcbd..b860b359c120318f7693e2816345c6f0a604d7db 100644 (file)
@@ -18,26 +18,26 @@ static void init_theme_simple(struct gui_theme *t)
        t->top_lines_min = 2;
        t->cols_min = 40;
        t->top_lines_default = 2;
-       t->sb_bg = COLOR_CYAN;
-       t->sb_fg = COLOR_BLACK;
-       t->cmd_bg = COLOR_WHITE;
-       t->cmd_fg = COLOR_BLACK;
-       t->output_bg = COLOR_BLUE;
-       t->output_fg = COLOR_WHITE;
-       t->msg_bg = COLOR_BLUE;
-       t->msg_fg = COLOR_YELLOW;
-       t->err_msg_bg = COLOR_RED;
-       t->err_msg_fg = COLOR_WHITE;
-       t->sep_bg = COLOR_BLUE;
-       t->sep_fg = COLOR_CYAN;
-       t->default_fg = COLOR_WHITE;
-       t->default_bg = COLOR_BLUE;
+       t->sb.bg = COLOR_CYAN;
+       t->sb.fg = COLOR_BLACK;
+       t->cmd.bg = COLOR_WHITE;
+       t->cmd.fg = COLOR_BLACK;
+       t->output.bg = COLOR_BLUE;
+       t->output.fg = COLOR_WHITE;
+       t->msg.bg = COLOR_BLUE;
+       t->msg.fg = COLOR_YELLOW;
+       t->err_msg.bg = COLOR_RED;
+       t->err_msg.fg = COLOR_WHITE;
+       t->sep.bg = COLOR_BLUE;
+       t->sep.fg = COLOR_CYAN;
+       t->dflt.fg = COLOR_WHITE;
+       t->dflt.bg = COLOR_BLUE;
        t->sep_char = '*';
 
        d[SI_BASENAME].prefix = "";
        d[SI_BASENAME].postfix = "";
-       d[SI_BASENAME].fg = COLOR_WHITE;
-       d[SI_BASENAME].bg = COLOR_BLUE;
+       d[SI_BASENAME].color.fg = COLOR_WHITE;
+       d[SI_BASENAME].color.bg = COLOR_BLUE;
        d[SI_BASENAME].align = CENTER;
        d[SI_BASENAME].x = 0;
        d[SI_BASENAME].y = 7;
@@ -45,8 +45,8 @@ static void init_theme_simple(struct gui_theme *t)
 
        d[SI_STATUS].prefix = "para_server: ";
        d[SI_STATUS].postfix = "";
-       d[SI_STATUS].fg = COLOR_WHITE;
-       d[SI_STATUS].bg = COLOR_BLUE;
+       d[SI_STATUS].color.fg = COLOR_WHITE;
+       d[SI_STATUS].color.bg = COLOR_BLUE;
        d[SI_STATUS].align = CENTER;
        d[SI_STATUS].x = 0;
        d[SI_STATUS].y = 60;
@@ -54,8 +54,8 @@ static void init_theme_simple(struct gui_theme *t)
 
        d[SI_AUDIOD_STATUS].prefix = "para_audiod: ";
        d[SI_AUDIOD_STATUS].postfix = "";
-       d[SI_AUDIOD_STATUS].fg = COLOR_WHITE;
-       d[SI_AUDIOD_STATUS].bg = COLOR_BLUE;
+       d[SI_AUDIOD_STATUS].color.fg = COLOR_WHITE;
+       d[SI_AUDIOD_STATUS].color.bg = COLOR_BLUE;
        d[SI_AUDIOD_STATUS].align = CENTER;
        d[SI_AUDIOD_STATUS].x = 50;
        d[SI_AUDIOD_STATUS].y = 60;
@@ -75,27 +75,27 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
        t->top_lines_min = 9;
        t->top_lines_default = 11; /* default number of lines */
 
-       t->sb_bg = COLOR_GREEN; /* status bar background */
-       t->sb_fg = COLOR_BLACK; /* status bar foreground */
-       t->cmd_bg = COLOR_BLACK;
-       t->cmd_fg = COLOR_YELLOW;
-       t->output_bg = COLOR_BLACK;
-       t->output_fg = COLOR_CYAN;
-       t->msg_bg = COLOR_BLACK;
-       t->msg_fg = COLOR_WHITE;
-       t->err_msg_bg = COLOR_RED;
-       t->err_msg_fg = COLOR_WHITE;
-       t->sep_bg = COLOR_BLACK; /* color of the separator */
-       t->sep_fg = COLOR_BLUE;
+       t->sb.bg = COLOR_GREEN; /* status bar background */
+       t->sb.fg = COLOR_BLACK; /* status bar foreground */
+       t->cmd.bg = COLOR_BLACK;
+       t->cmd.fg = COLOR_YELLOW;
+       t->output.bg = COLOR_BLACK;
+       t->output.fg = COLOR_CYAN;
+       t->msg.bg = COLOR_BLACK;
+       t->msg.fg = COLOR_WHITE;
+       t->err_msg.bg = COLOR_RED;
+       t->err_msg.fg = COLOR_WHITE;
+       t->sep.bg = COLOR_BLACK; /* color of the separator */
+       t->sep.fg = COLOR_BLUE;
        t->sep_char = 0; /* default (ACS_HLINE) */
-       t->default_bg = COLOR_BLACK;
-       t->default_fg = COLOR_MAGENTA;
+       t->dflt.bg = COLOR_BLACK;
+       t->dflt.fg = COLOR_MAGENTA;
 
 
        d[SI_PLAY_TIME].prefix = "";
        d[SI_PLAY_TIME].postfix = "";
-       d[SI_PLAY_TIME].fg = COLOR_CYAN;
-       d[SI_PLAY_TIME].bg = COLOR_BLACK;
+       d[SI_PLAY_TIME].color.fg = COLOR_CYAN;
+       d[SI_PLAY_TIME].color.bg = COLOR_BLACK;
        d[SI_PLAY_TIME].align = CENTER;
        d[SI_PLAY_TIME].x = 0;
        d[SI_PLAY_TIME].y = 7;
@@ -103,8 +103,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_BASENAME].prefix = "";
        d[SI_BASENAME].postfix = "";
-       d[SI_BASENAME].fg = COLOR_CYAN;
-       d[SI_BASENAME].bg = COLOR_BLACK;
+       d[SI_BASENAME].color.fg = COLOR_CYAN;
+       d[SI_BASENAME].color.bg = COLOR_BLACK;
        d[SI_BASENAME].align = LEFT;
        d[SI_BASENAME].x = 35;
        d[SI_BASENAME].y = 7;
@@ -112,8 +112,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_STATUS].prefix = "";
        d[SI_STATUS].postfix = " ";
-       d[SI_STATUS].fg = COLOR_RED;
-       d[SI_STATUS].bg = COLOR_BLACK;
+       d[SI_STATUS].color.fg = COLOR_RED;
+       d[SI_STATUS].color.bg = COLOR_BLACK;
        d[SI_STATUS].align = RIGHT;
        d[SI_STATUS].x = 0;
        d[SI_STATUS].y = 17;
@@ -121,8 +121,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_STATUS_FLAGS].prefix = "(";
        d[SI_STATUS_FLAGS].postfix = ")";
-       d[SI_STATUS_FLAGS].fg = COLOR_RED;
-       d[SI_STATUS_FLAGS].bg = COLOR_BLACK;
+       d[SI_STATUS_FLAGS].color.fg = COLOR_RED;
+       d[SI_STATUS_FLAGS].color.bg = COLOR_BLACK;
        d[SI_STATUS_FLAGS].align = LEFT;
        d[SI_STATUS_FLAGS].x = 11;
        d[SI_STATUS_FLAGS].y = 17;
@@ -130,8 +130,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_IMAGE_ID].prefix = "img: ";
        d[SI_IMAGE_ID].postfix = "";
-       d[SI_IMAGE_ID].fg = COLOR_RED;
-       d[SI_IMAGE_ID].bg = COLOR_BLACK;
+       d[SI_IMAGE_ID].color.fg = COLOR_RED;
+       d[SI_IMAGE_ID].color.bg = COLOR_BLACK;
        d[SI_IMAGE_ID].align = CENTER;
        d[SI_IMAGE_ID].x = 21;
        d[SI_IMAGE_ID].y = 17;
@@ -139,8 +139,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_LYRICS_ID].prefix = "lyr: ";
        d[SI_LYRICS_ID].postfix = "";
-       d[SI_LYRICS_ID].fg = COLOR_RED;
-       d[SI_LYRICS_ID].bg = COLOR_BLACK;
+       d[SI_LYRICS_ID].color.fg = COLOR_RED;
+       d[SI_LYRICS_ID].color.bg = COLOR_BLACK;
        d[SI_LYRICS_ID].align = CENTER;
        d[SI_LYRICS_ID].x = 31;
        d[SI_LYRICS_ID].y = 17;
@@ -148,8 +148,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_FORMAT].prefix = "format: ";
        d[SI_FORMAT].postfix = "";
-       d[SI_FORMAT].fg = COLOR_RED;
-       d[SI_FORMAT].bg = COLOR_BLACK;
+       d[SI_FORMAT].color.fg = COLOR_RED;
+       d[SI_FORMAT].color.bg = COLOR_BLACK;
        d[SI_FORMAT].align = CENTER;
        d[SI_FORMAT].x = 42;
        d[SI_FORMAT].y = 17;
@@ -157,8 +157,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_NUM_PLAYED].prefix = "#";
        d[SI_NUM_PLAYED].postfix = "";
-       d[SI_NUM_PLAYED].fg = COLOR_RED;
-       d[SI_NUM_PLAYED].bg = COLOR_BLACK;
+       d[SI_NUM_PLAYED].color.fg = COLOR_RED;
+       d[SI_NUM_PLAYED].color.bg = COLOR_BLACK;
        d[SI_NUM_PLAYED].align = LEFT;
        d[SI_NUM_PLAYED].x = 60;
        d[SI_NUM_PLAYED].y = 17;
@@ -166,8 +166,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_BITRATE].prefix = "";
        d[SI_BITRATE].postfix = "";
-       d[SI_BITRATE].fg = COLOR_RED;
-       d[SI_BITRATE].bg = COLOR_BLACK;
+       d[SI_BITRATE].color.fg = COLOR_RED;
+       d[SI_BITRATE].color.bg = COLOR_BLACK;
        d[SI_BITRATE].align = CENTER;
        d[SI_BITRATE].x = 65;
        d[SI_BITRATE].y = 17;
@@ -175,8 +175,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_FREQUENCY].prefix = "";
        d[SI_FREQUENCY].postfix = "";
-       d[SI_FREQUENCY].fg = COLOR_RED;
-       d[SI_FREQUENCY].bg = COLOR_BLACK;
+       d[SI_FREQUENCY].color.fg = COLOR_RED;
+       d[SI_FREQUENCY].color.bg = COLOR_BLACK;
        d[SI_FREQUENCY].align = CENTER;
        d[SI_FREQUENCY].x = 78;
        d[SI_FREQUENCY].y = 17;
@@ -184,8 +184,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_SCORE].prefix = "sc: ";
        d[SI_SCORE].postfix = "";
-       d[SI_SCORE].fg = COLOR_RED;
-       d[SI_SCORE].bg = COLOR_BLACK;
+       d[SI_SCORE].color.fg = COLOR_RED;
+       d[SI_SCORE].color.bg = COLOR_BLACK;
        d[SI_SCORE].align = CENTER;
        d[SI_SCORE].x = 88;
        d[SI_SCORE].y = 17;
@@ -193,8 +193,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_AUDIOD_STATUS].prefix = "";
        d[SI_AUDIOD_STATUS].postfix = "";
-       d[SI_AUDIOD_STATUS].fg = COLOR_MAGENTA;
-       d[SI_AUDIOD_STATUS].bg = COLOR_BLACK;
+       d[SI_AUDIOD_STATUS].color.fg = COLOR_MAGENTA;
+       d[SI_AUDIOD_STATUS].color.bg = COLOR_BLACK;
        d[SI_AUDIOD_STATUS].align = CENTER;
        d[SI_AUDIOD_STATUS].x = 0;
        d[SI_AUDIOD_STATUS].y = 27;
@@ -202,8 +202,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_DECODER_FLAGS].prefix = "[";
        d[SI_DECODER_FLAGS].postfix = "]";
-       d[SI_DECODER_FLAGS].fg = COLOR_MAGENTA;
-       d[SI_DECODER_FLAGS].bg = COLOR_BLACK;
+       d[SI_DECODER_FLAGS].color.fg = COLOR_MAGENTA;
+       d[SI_DECODER_FLAGS].color.bg = COLOR_BLACK;
        d[SI_DECODER_FLAGS].align = CENTER;
        d[SI_DECODER_FLAGS].x = 5;
        d[SI_DECODER_FLAGS].y = 27;
@@ -211,8 +211,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_MTIME].prefix = "mod: ";
        d[SI_MTIME].postfix = "";
-       d[SI_MTIME].fg = COLOR_MAGENTA;
-       d[SI_MTIME].bg = COLOR_BLACK;
+       d[SI_MTIME].color.fg = COLOR_MAGENTA;
+       d[SI_MTIME].color.bg = COLOR_BLACK;
        d[SI_MTIME].align = CENTER;
        d[SI_MTIME].x = 15;
        d[SI_MTIME].y = 27;
@@ -220,8 +220,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_FILE_SIZE].prefix = "";
        d[SI_FILE_SIZE].postfix = "kb";
-       d[SI_FILE_SIZE].fg = COLOR_MAGENTA;
-       d[SI_FILE_SIZE].bg = COLOR_BLACK;
+       d[SI_FILE_SIZE].color.fg = COLOR_MAGENTA;
+       d[SI_FILE_SIZE].color.bg = COLOR_BLACK;
        d[SI_FILE_SIZE].align = CENTER;
        d[SI_FILE_SIZE].x = 37;
        d[SI_FILE_SIZE].y = 27;
@@ -229,8 +229,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_CHANNELS].prefix = "";
        d[SI_CHANNELS].postfix = "ch";
-       d[SI_CHANNELS].fg = COLOR_MAGENTA;
-       d[SI_CHANNELS].bg = COLOR_BLACK;
+       d[SI_CHANNELS].color.fg = COLOR_MAGENTA;
+       d[SI_CHANNELS].color.bg = COLOR_BLACK;
        d[SI_CHANNELS].align = CENTER;
        d[SI_CHANNELS].x = 47;
        d[SI_CHANNELS].y = 27;
@@ -238,8 +238,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_LAST_PLAYED].prefix = "lp: ";
        d[SI_LAST_PLAYED].postfix = "";
-       d[SI_LAST_PLAYED].fg = COLOR_MAGENTA;
-       d[SI_LAST_PLAYED].bg = COLOR_BLACK;
+       d[SI_LAST_PLAYED].color.fg = COLOR_MAGENTA;
+       d[SI_LAST_PLAYED].color.bg = COLOR_BLACK;
        d[SI_LAST_PLAYED].align = CENTER;
        d[SI_LAST_PLAYED].x = 52;
        d[SI_LAST_PLAYED].y = 27;
@@ -247,8 +247,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_NUM_CHUNKS].prefix = "";
        d[SI_NUM_CHUNKS].postfix = "x";
-       d[SI_NUM_CHUNKS].fg = COLOR_MAGENTA;
-       d[SI_NUM_CHUNKS].bg = COLOR_BLACK;
+       d[SI_NUM_CHUNKS].color.fg = COLOR_MAGENTA;
+       d[SI_NUM_CHUNKS].color.bg = COLOR_BLACK;
        d[SI_NUM_CHUNKS].align = RIGHT;
        d[SI_NUM_CHUNKS].x = 73;
        d[SI_NUM_CHUNKS].y = 27;
@@ -256,8 +256,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_CHUNK_TIME].prefix = "";
        d[SI_CHUNK_TIME].postfix = "ms";
-       d[SI_CHUNK_TIME].fg = COLOR_MAGENTA;
-       d[SI_CHUNK_TIME].bg = COLOR_BLACK;
+       d[SI_CHUNK_TIME].color.fg = COLOR_MAGENTA;
+       d[SI_CHUNK_TIME].color.bg = COLOR_BLACK;
        d[SI_CHUNK_TIME].align = LEFT;
        d[SI_CHUNK_TIME].x = 84;
        d[SI_CHUNK_TIME].y = 27;
@@ -265,8 +265,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_AMPLIFICATION].prefix = "amp:";
        d[SI_AMPLIFICATION].postfix = "";
-       d[SI_AMPLIFICATION].fg = COLOR_MAGENTA;
-       d[SI_AMPLIFICATION].bg = COLOR_BLACK;
+       d[SI_AMPLIFICATION].color.fg = COLOR_MAGENTA;
+       d[SI_AMPLIFICATION].color.bg = COLOR_BLACK;
        d[SI_AMPLIFICATION].align = RIGHT;
        d[SI_AMPLIFICATION].x = 92;
        d[SI_AMPLIFICATION].y = 27;
@@ -274,8 +274,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_TECHINFO].prefix = "";
        d[SI_TECHINFO].postfix = "";
-       d[SI_TECHINFO].fg = COLOR_GREEN;
-       d[SI_TECHINFO].bg = COLOR_BLACK;
+       d[SI_TECHINFO].color.fg = COLOR_GREEN;
+       d[SI_TECHINFO].color.bg = COLOR_BLACK;
        d[SI_TECHINFO].align = CENTER;
        d[SI_TECHINFO].x = 0;
        d[SI_TECHINFO].y = 43;
@@ -283,8 +283,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_TITLE].prefix = "";
        d[SI_TITLE].postfix = ",";
-       d[SI_TITLE].fg = COLOR_GREEN;
-       d[SI_TITLE].bg = COLOR_BLACK;
+       d[SI_TITLE].color.fg = COLOR_GREEN;
+       d[SI_TITLE].color.bg = COLOR_BLACK;
        d[SI_TITLE].align = RIGHT;
        d[SI_TITLE].x = 0;
        d[SI_TITLE].y = 53;
@@ -292,8 +292,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_ARTIST].prefix = " by ";
        d[SI_ARTIST].postfix = "";
-       d[SI_ARTIST].fg = COLOR_GREEN;
-       d[SI_ARTIST].bg = COLOR_BLACK;
+       d[SI_ARTIST].color.fg = COLOR_GREEN;
+       d[SI_ARTIST].color.bg = COLOR_BLACK;
        d[SI_ARTIST].align = LEFT;
        d[SI_ARTIST].x = 45;
        d[SI_ARTIST].y = 53;
@@ -301,8 +301,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_YEAR].prefix = "(";
        d[SI_YEAR].postfix = ")";
-       d[SI_YEAR].fg = COLOR_GREEN;
-       d[SI_YEAR].bg = COLOR_BLACK;
+       d[SI_YEAR].color.fg = COLOR_GREEN;
+       d[SI_YEAR].color.bg = COLOR_BLACK;
        d[SI_YEAR].align = RIGHT;
        d[SI_YEAR].x = 90;
        d[SI_YEAR].y = 53;
@@ -310,8 +310,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_ALBUM].prefix = "A: ";
        d[SI_ALBUM].postfix = ",";
-       d[SI_ALBUM].fg = COLOR_GREEN;
-       d[SI_ALBUM].bg = COLOR_BLACK;
+       d[SI_ALBUM].color.fg = COLOR_GREEN;
+       d[SI_ALBUM].color.bg = COLOR_BLACK;
        d[SI_ALBUM].align = RIGHT;
        d[SI_ALBUM].x = 0;
        d[SI_ALBUM].y = 63;
@@ -319,8 +319,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_COMMENT].prefix = " C: ";
        d[SI_COMMENT].postfix = "";
-       d[SI_COMMENT].fg = COLOR_GREEN;
-       d[SI_COMMENT].bg = COLOR_BLACK;
+       d[SI_COMMENT].color.fg = COLOR_GREEN;
+       d[SI_COMMENT].color.bg = COLOR_BLACK;
        d[SI_COMMENT].align = LEFT;
        d[SI_COMMENT].x = 50;
        d[SI_COMMENT].y = 63;
@@ -328,8 +328,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_AFS_MODE].prefix = "";
        d[SI_AFS_MODE].postfix = "";
-       d[SI_AFS_MODE].fg = COLOR_YELLOW;
-       d[SI_AFS_MODE].bg = COLOR_BLACK;
+       d[SI_AFS_MODE].color.fg = COLOR_YELLOW;
+       d[SI_AFS_MODE].color.bg = COLOR_BLACK;
        d[SI_AFS_MODE].align = CENTER;
        d[SI_AFS_MODE].x = 0;
        d[SI_AFS_MODE].y = 77;
@@ -337,8 +337,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_ATTRIBUTES_TXT].prefix = "";
        d[SI_ATTRIBUTES_TXT].postfix = "";
-       d[SI_ATTRIBUTES_TXT].fg = COLOR_YELLOW;
-       d[SI_ATTRIBUTES_TXT].bg = COLOR_BLACK;
+       d[SI_ATTRIBUTES_TXT].color.fg = COLOR_YELLOW;
+       d[SI_ATTRIBUTES_TXT].color.bg = COLOR_BLACK;
        d[SI_ATTRIBUTES_TXT].align = CENTER;
        d[SI_ATTRIBUTES_TXT].x = 0;
        d[SI_ATTRIBUTES_TXT].y = 87;
@@ -346,8 +346,8 @@ static void init_theme_colorful_blackness(struct gui_theme *t)
 
        d[SI_DIRECTORY].prefix = "dir: ";
        d[SI_DIRECTORY].postfix = "";
-       d[SI_DIRECTORY].fg = COLOR_YELLOW;
-       d[SI_DIRECTORY].bg = COLOR_BLACK;
+       d[SI_DIRECTORY].color.fg = COLOR_YELLOW;
+       d[SI_DIRECTORY].color.bg = COLOR_BLACK;
        d[SI_DIRECTORY].align = CENTER;
        d[SI_DIRECTORY].x = 0;
        d[SI_DIRECTORY].y = 97;