diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-03-05 18:28:39 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-03-05 18:28:39 +0100 |
commit | d99111c73b29ff3b047e911fb02c82e3e2dc8bea (patch) | |
tree | 39d18f54e8608350a2897522f7d5f8d48f4e68e0 /source | |
parent | bfd338dfc89d22c5366f9a5aa0391c279701243e (diff) |
Remove deprecated theme system.
Diffstat (limited to 'source')
-rw-r--r-- | source/helper.c | 5 | ||||
-rw-r--r-- | source/textbox.c | 27 | ||||
-rw-r--r-- | source/x11-helper.c | 43 | ||||
-rw-r--r-- | source/xrmoptions.c | 32 |
4 files changed, 17 insertions, 90 deletions
diff --git a/source/helper.c b/source/helper.c index 7f328404..e4439ea3 100644 --- a/source/helper.c +++ b/source/helper.c @@ -516,11 +516,6 @@ void remove_pid_file ( int fd ) */ int config_sanity_check ( void ) { - // If alternative row is not set, copy the normal background color. - // Do this at the beginning as we might use it in the error dialog. - if ( config.menu_bg_alt == NULL ) { - config.menu_bg_alt = config.menu_bg; - } int found_error = FALSE; GString *msg = g_string_new ( "<big><b>The configuration failed to validate:</b></big>\n" ); diff --git a/source/textbox.c b/source/textbox.c index 613d34bb..29fb2149 100644 --- a/source/textbox.c +++ b/source/textbox.c @@ -647,30 +647,9 @@ static void textbox_parse_string ( const char *str, RowColor *color ) } void textbox_setup ( void ) { - if ( config.color_enabled ) { - textbox_parse_string ( config.color_normal, &( colors[NORMAL] ) ); - textbox_parse_string ( config.color_urgent, &( colors[URGENT] ) ); - textbox_parse_string ( config.color_active, &( colors[ACTIVE] ) ); - } - else { - colors[NORMAL].bg = color_get ( config.menu_bg ); - colors[NORMAL].fg = color_get ( config.menu_fg ); - colors[NORMAL].bgalt = color_get ( config.menu_bg_alt ); - colors[NORMAL].hlfg = color_get ( config.menu_hlfg ); - colors[NORMAL].hlbg = color_get ( config.menu_hlbg ); - - colors[URGENT].bg = color_get ( config.menu_bg_urgent ); - colors[URGENT].fg = color_get ( config.menu_fg_urgent ); - colors[URGENT].bgalt = color_get ( config.menu_bg_alt ); - colors[URGENT].hlfg = color_get ( config.menu_hlfg_urgent ); - colors[URGENT].hlbg = color_get ( config.menu_hlbg_urgent ); - - colors[ACTIVE].bg = color_get ( config.menu_bg_active ); - colors[ACTIVE].fg = color_get ( config.menu_fg_active ); - colors[ACTIVE].bgalt = color_get ( config.menu_bg_alt ); - colors[ACTIVE].hlfg = color_get ( config.menu_hlfg_active ); - colors[ACTIVE].hlbg = color_get ( config.menu_hlbg_active ); - } + textbox_parse_string ( config.color_normal, &( colors[NORMAL] ) ); + textbox_parse_string ( config.color_urgent, &( colors[URGENT] ) ); + textbox_parse_string ( config.color_active, &( colors[ACTIVE] ) ); } void textbox_set_pango_context ( PangoContext *p ) diff --git a/source/x11-helper.c b/source/x11-helper.c index 35122274..4987c3c1 100644 --- a/source/x11-helper.c +++ b/source/x11-helper.c @@ -634,16 +634,11 @@ static struct void color_background ( cairo_t *d ) { if ( !color_cache[BACKGROUND].set ) { - if ( !config.color_enabled ) { - color_cache[BACKGROUND].color = color_get ( config.menu_bg ); - } - else { - gchar **vals = g_strsplit ( config.color_window, ",", 3 ); - if ( vals != NULL && vals[0] != NULL ) { - color_cache[BACKGROUND].color = color_get ( vals[0] ); - } - g_strfreev ( vals ); + gchar **vals = g_strsplit ( config.color_window, ",", 3 ); + if ( vals != NULL && vals[0] != NULL ) { + color_cache[BACKGROUND].color = color_get ( vals[0] ); } + g_strfreev ( vals ); color_cache[BACKGROUND].set = TRUE; } @@ -653,16 +648,11 @@ void color_background ( cairo_t *d ) void color_border ( cairo_t *d ) { if ( !color_cache[BORDER].set ) { - if ( !config.color_enabled ) { - color_cache[BORDER].color = color_get ( config.menu_bc ); - } - else { - gchar **vals = g_strsplit ( config.color_window, ",", 3 ); - if ( vals != NULL && vals[0] != NULL && vals[1] != NULL ) { - color_cache[BORDER].color = color_get ( vals[1] ); - } - g_strfreev ( vals ); + gchar **vals = g_strsplit ( config.color_window, ",", 3 ); + if ( vals != NULL && vals[0] != NULL && vals[1] != NULL ) { + color_cache[BORDER].color = color_get ( vals[1] ); } + g_strfreev ( vals ); color_cache[BORDER].set = TRUE; } x11_helper_set_cairo_rgba ( d, color_cache[BORDER].color ); @@ -671,19 +661,14 @@ void color_border ( cairo_t *d ) void color_separator ( cairo_t *d ) { if ( !color_cache[SEPARATOR].set ) { - if ( !config.color_enabled ) { - color_cache[SEPARATOR].color = color_get ( config.menu_bc ); + gchar **vals = g_strsplit ( config.color_window, ",", 3 ); + if ( vals != NULL && vals[0] != NULL && vals[1] != NULL && vals[2] != NULL ) { + color_cache[SEPARATOR].color = color_get ( vals[2] ); } - else { - gchar **vals = g_strsplit ( config.color_window, ",", 3 ); - if ( vals != NULL && vals[0] != NULL && vals[1] != NULL && vals[2] != NULL ) { - color_cache[SEPARATOR].color = color_get ( vals[2] ); - } - else if ( vals != NULL && vals[0] != NULL && vals[1] != NULL ) { - color_cache[SEPARATOR].color = color_get ( vals[1] ); - } - g_strfreev ( vals ); + else if ( vals != NULL && vals[0] != NULL && vals[1] != NULL ) { + color_cache[SEPARATOR].color = color_get ( vals[1] ); } + g_strfreev ( vals ); color_cache[SEPARATOR].set = TRUE; } x11_helper_set_cairo_rgba ( d, color_cache[SEPARATOR].color ); diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 6fff1015..2ac9bcbd 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -71,34 +71,6 @@ static XrmOption xrmOptions[] = { { xrm_Number, "columns", { .num = &config.menu_columns }, NULL, "Number of columns" }, { xrm_String, "font", { .str = &config.menu_font }, NULL, "Font to use" }, - /* Foreground color */ - { xrm_String, "foreground", { .str = &config.menu_fg }, NULL, "" }, - { xrm_String, "fg", { .str = &config.menu_fg }, NULL, "Foreground color" }, - { xrm_String, "background", { .str = &config.menu_bg }, NULL, "" }, - { xrm_String, "bg", { .str = &config.menu_bg }, NULL, "Background color" }, - - { xrm_String, "fg-active", { .str = &config.menu_fg_active }, NULL, "Foreground color for active row" }, - { xrm_String, "fg-urgent", { .str = &config.menu_fg_urgent }, NULL, "Foreground color for urgent row" }, - { xrm_String, "hlfg-active", { .str = &config.menu_hlfg_active }, NULL, "Foreground color for highlighted active row" }, - { xrm_String, "hlfg-urgent", { .str = &config.menu_hlfg_urgent }, NULL, "Foreground color for highlighted urgent row" }, - - { xrm_String, "bg-active", { .str = &config.menu_bg_active }, NULL, "Background color for active row" }, - { xrm_String, "bg-urgent", { .str = &config.menu_bg_urgent }, NULL, "Background color for urgent row" }, - { xrm_String, "hlbg-active", { .str = &config.menu_hlbg_active }, NULL, "Background color for highlighted active row" }, - { xrm_String, "hlbg-urgent", { .str = &config.menu_hlbg_urgent }, NULL, "Background color for highlighted urgent row" }, - - { xrm_String, "background-alternate", { .str = &config.menu_bg_alt }, NULL, "" }, - { xrm_String, "bgalt", { .str = &config.menu_bg_alt }, NULL, "Background color for alternating row" }, - - { xrm_String, "highlightfg", { .str = &config.menu_hlfg }, NULL, "" }, - { xrm_String, "hlfg", { .str = &config.menu_hlfg }, NULL, "Foreground color for highlighted row" }, - - { xrm_String, "highlightbg", { .str = &config.menu_hlbg }, NULL, "" }, - { xrm_String, "hlbg", { .str = &config.menu_hlbg }, NULL, "Background color for highlighted row" }, - - { xrm_String, "bordercolor", { .str = &config.menu_bc }, NULL, "" }, - { xrm_String, "bc", { .str = &config.menu_bc }, NULL, "Border color" }, - { xrm_Boolean, "color-enabled", { .num = &config.color_enabled }, NULL, "Use extended color scheme" }, { xrm_String, "color-normal", { .str = &config.color_normal }, NULL, "Color scheme for normal row" }, { xrm_String, "color-urgent", { .str = &config.color_urgent }, NULL, "Color scheme for urgent row" }, { xrm_String, "color-active", { .str = &config.color_active }, NULL, "Color scheme for active row" }, @@ -547,10 +519,6 @@ void print_help_msg ( const char *option, const char *type, const char*text, con void config_parse_xresources_theme_dump ( void ) { - if ( config.color_enabled != TRUE ) { - printf ( "! Dumping theme only works for the extended color scheme.\n" ); - return; - } printf ( "! ------------------------------------------------------------------------------\n" ); printf ( "! ROFI Color theme\n" ); printf ( "! User: %s\n", g_get_user_name () ); |