diff --git a/Makefile.am b/Makefile.am index 11656189..b4528d7a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -155,7 +155,6 @@ rofi_CFLAGS=\ -I$(top_builddir)/\ -Werror=missing-prototypes\ -DSYSCONFDIR=\"$(sysconfdir)\"\ - -DTHEME_CONVERTER\ -DPLUGIN_PATH=\"${libdir}/rofi\"\ -DTHEME_DIR=\"$(themedir)\" diff --git a/config/config.c b/config/config.c index 2c91f6d4..b5f40d2e 100644 --- a/config/config.c +++ b/config/config.c @@ -140,10 +140,6 @@ Settings config = { .window_format = "{w} {c} {t}", .click_to_exit = TRUE, .theme = NULL, - .color_normal = NULL, - .color_active = NULL, - .color_urgent = NULL, - .color_window = NULL, .plugin_path = PLUGIN_PATH, .max_history_size = 25, .combi_hide_mode_prefix = FALSE, diff --git a/include/settings.h b/include/settings.h index 2ca15a31..d70359b5 100644 --- a/include/settings.h +++ b/include/settings.h @@ -64,12 +64,6 @@ typedef struct /** Font string (pango format) */ char * menu_font; - /** New row colors */ - char * color_normal; - char * color_active; - char * color_urgent; - char * color_window; - /** Whether to load and show icons */ gboolean show_icons; diff --git a/include/theme.h b/include/theme.h index 9ac1b679..4e2651ed 100644 --- a/include/theme.h +++ b/include/theme.h @@ -354,12 +354,6 @@ gboolean rofi_theme_is_empty ( void ); * Reset the current theme. */ void rofi_theme_reset ( void ); -#ifdef THEME_CONVERTER -/** - * Convert old theme colors into default one. - */ -void rofi_theme_convert_old ( void ); -#endif /** * @param file File name passed to option. diff --git a/meson.build b/meson.build index 8d6d2ea6..cfe9817e 100644 --- a/meson.build +++ b/meson.build @@ -84,7 +84,6 @@ header_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) header_conf.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/davatorium/rofi/') header_conf.set_quoted('PACKAGE_URL', 'https://reddit.com/r/qtools/') -header_conf.set('THEME_CONVERTER', true) header_conf.set('_GNU_SOURCE', true) header_conf.set('USE_NK_GIT_VERSION', true) diff --git a/source/dialogs/script.c b/source/dialogs/script.c index 9bc33af7..3fa2ec8c 100644 --- a/source/dialogs/script.c +++ b/source/dialogs/script.c @@ -78,7 +78,7 @@ typedef struct /** * Shared function between DMENU and Script mode. */ -void dmenuscript_parse_entry_extras ( G_GNUC_UNUSED Mode *sw, DmenuScriptEntry *entry, char *buffer, size_t length ) +void dmenuscript_parse_entry_extras ( G_GNUC_UNUSED Mode *sw, DmenuScriptEntry *entry, char *buffer, G_GNUC_UNUSED size_t length ) { gchar **extras = g_strsplit ( buffer, "\x1f", -1 ); gchar **extra; diff --git a/source/rofi.c b/source/rofi.c index 81f3e789..997b201e 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -992,7 +992,6 @@ int main ( int argc, char *argv[] ) } g_bytes_unref ( theme_data ); } - rofi_theme_convert_old (); } /** diff --git a/source/theme.c b/source/theme.c index 0c2d1ed6..372147be 100644 --- a/source/theme.c +++ b/source/theme.c @@ -1086,128 +1086,6 @@ gboolean rofi_theme_is_empty ( void ) return FALSE; } -#ifdef THEME_CONVERTER - -static char * rofi_theme_convert_color ( char *col ) -{ - char *r = g_strstrip ( col ); - if ( *r == '#' && strlen ( r ) == 9 ) { - char a1 = r[1]; - char a2 = r[2]; - r[1] = r[3]; - r[2] = r[4]; - r[3] = r[5]; - r[4] = r[6]; - r[5] = r[7]; - r[6] = r[8]; - r[7] = a1; - r[8] = a2; - } - - return r; -} -void rofi_theme_convert_old ( void ) -{ - if ( config.color_window ) { - char **retv = g_strsplit ( config.color_window, ",", -1 ); - const char * const conf[] = { - "* { background: %s; }", - "* { border-color: %s; }", - "* { separatorcolor: %s; }" - }; - for ( int i = 0; retv && i < 3 && retv[i]; i++ ) { - char *str = g_strdup_printf ( conf[i], rofi_theme_convert_color ( retv[i] ) ); - rofi_theme_parse_string ( str ); - g_free ( str ); - } - g_strfreev ( retv ); - } - if ( config.color_normal ) { - char **retv = g_strsplit ( config.color_normal, ",", -1 ); - const char * const conf[] = { - "* { normal-background: %s; }", - "* { foreground: %s; normal-foreground: @foreground; alternate-normal-foreground: @foreground; }", - "* { alternate-normal-background: %s; }", - "* { selected-normal-background: %s; }", - "* { selected-normal-foreground: %s; }" - }; - for ( int i = 0; retv && retv[i] && i < 5; i++ ) { - char *str = g_strdup_printf ( conf[i], rofi_theme_convert_color ( retv[i] ) ); - rofi_theme_parse_string ( str ); - g_free ( str ); - } - g_strfreev ( retv ); - } - if ( config.color_urgent ) { - char **retv = g_strsplit ( config.color_urgent, ",", -1 ); - const char * const conf[] = { - "* { urgent-background: %s; }", - "* { urgent-foreground: %s; alternate-urgent-foreground: @urgent-foreground;}", - "* { alternate-urgent-background: %s; }", - "* { selected-urgent-background: %s; }", - "* { selected-urgent-foreground: %s; }" - }; - for ( int i = 0; retv && retv[i] && i < 5; i++ ) { - char *str = g_strdup_printf ( conf[i], rofi_theme_convert_color ( retv[i] ) ); - rofi_theme_parse_string ( str ); - g_free ( str ); - } - g_strfreev ( retv ); - } - if ( config.color_active ) { - char **retv = g_strsplit ( config.color_active, ",", -1 ); - const char * const conf[] = { - "* { active-background: %s; }", - "* { active-foreground: %s; alternate-active-foreground: @active-foreground;}", - "* { alternate-active-background: %s; }", - "* { selected-active-background: %s; }", - "* { selected-active-foreground: %s; }" - }; - for ( int i = 0; retv && retv[i] && i < 5; i++ ) { - char *str = g_strdup_printf ( conf[i], rofi_theme_convert_color ( retv[i] ) ); - rofi_theme_parse_string ( str ); - g_free ( str ); - } - g_strfreev ( retv ); - } - - if ( config.separator_style != NULL ) { - if ( g_strcmp0 ( config.separator_style, "none" ) == 0 ) { - const char *const str = "#listview { border: 0px; }"; - rofi_theme_parse_string ( str ); - const char *const str2 = "#mode-switcher { border: 0px; }"; - rofi_theme_parse_string ( str2 ); - const char *const str3 = "#message { border: 0px; }"; - rofi_theme_parse_string ( str3 ); - } - else if ( g_strcmp0 ( config.separator_style, "solid" ) == 0 ) { - const char *const str = "#listview { border: 2px solid 0px 0px 0px; }"; - rofi_theme_parse_string ( str ); - const char *const str2 = "#mode-switcher { border: 2px solid 0px 0px 0px; }"; - rofi_theme_parse_string ( str2 ); - const char *const str3 = "#message { border: 2px solid 0px 0px 0px; }"; - rofi_theme_parse_string ( str3 ); - } /* dash is default */ - } - if ( config.hide_scrollbar ) { - const char *str = "#listview { scrollbar: false; }"; - rofi_theme_parse_string ( str ); - } - else { - const char *str = "#listview { scrollbar: true; }"; - rofi_theme_parse_string ( str ); - char *str2 = g_strdup_printf ( "#scrollbar { handle-width: %dpx; }", config.scrollbar_width ); - rofi_theme_parse_string ( str2 ); - g_free ( str2 ); - } - if ( config.fake_transparency ) { - char *str = g_strdup_printf ( "#window { transparency: \"%s\"; }", config.fake_background ); - rofi_theme_parse_string ( str ); - g_free ( str ); - } -} -#endif // THEME_CONVERTER - char * rofi_theme_parse_prepare_file ( const char *file, const char *parent_file ) { char *filename = rofi_expand_path ( file ); diff --git a/source/xrmoptions.c b/source/xrmoptions.c index d76cd1fa..fcacc69b 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -192,14 +192,6 @@ static XrmOption xrmOptions[] = { "Click outside the window to exit", CONFIG_DEFAULT }, { xrm_String, "theme", { .str = &config.theme }, NULL, "New style theme file", CONFIG_DEFAULT }, - { xrm_String, "color-normal", { .str = &config.color_normal }, NULL, - "Color scheme for normal row", CONFIG_DEFAULT }, - { xrm_String, "color-urgent", { .str = &config.color_urgent }, NULL, - "Color scheme for urgent row", CONFIG_DEFAULT }, - { xrm_String, "color-active", { .str = &config.color_active }, NULL, - "Color scheme for active row", CONFIG_DEFAULT }, - { xrm_String, "color-window", { .str = &config.color_window }, NULL, - "Color scheme window", CONFIG_DEFAULT }, { xrm_Number, "max-history-size", { .num = &config.max_history_size }, NULL, "Max history size (WARNING: can cause slowdowns when set to high).", CONFIG_DEFAULT }, { xrm_Boolean, "combi-hide-mode-prefix", { .snum = &config.combi_hide_mode_prefix }, NULL,