launcher: New option launcher_icon_theme_override to preserve legacy behavior
o9000 o9000
6 files changed,
29 insertions(+),
5 deletions(-)
M
src/config.c
→
src/config.c
@@ -664,6 +664,9 @@ if (icon_theme_name_config)
free(icon_theme_name_config); icon_theme_name_config = strdup(value); } + else if (strcmp(key, "launcher_icon_theme_override") == 0) { + launcher_icon_theme_override = atoi(value); + } else if (strcmp(key, "launcher_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); launcher_alpha = atoi(value1);
M
src/launcher/launcher.c
→
src/launcher/launcher.c
@@ -53,6 +53,7 @@ int launcher_saturation;
int launcher_brightness; char *icon_theme_name_config; char *icon_theme_name_xsettings; +int launcher_icon_theme_override; XSettingsClient *xsettings_client; int startup_notifications;@@ -69,6 +70,7 @@ launcher_saturation = 0;
launcher_brightness = 0; icon_theme_name_config = NULL; icon_theme_name_xsettings = NULL; + launcher_icon_theme_override = 0; xsettings_client = NULL; startup_notifications = 0; }@@ -486,9 +488,15 @@
// Populates the list_themes list void launcher_load_themes(Launcher *launcher) { - launcher->list_themes = load_themes(icon_theme_name_config - ? icon_theme_name_config - : icon_theme_name_xsettings - ? icon_theme_name_xsettings - : "hicolor"); + launcher->list_themes = load_themes(launcher_icon_theme_override + ? (icon_theme_name_config + ? icon_theme_name_config + : icon_theme_name_xsettings + ? icon_theme_name_xsettings + : "hicolor") + : (icon_theme_name_xsettings + ? icon_theme_name_xsettings + : icon_theme_name_config + ? icon_theme_name_config + : "hicolor")); }
M
src/launcher/launcher.h
→
src/launcher/launcher.h
@@ -42,6 +42,7 @@ extern int launcher_saturation;
extern int launcher_brightness; extern char *icon_theme_name_xsettings; // theme name extern char *icon_theme_name_config; +extern int launcher_icon_theme_override; extern XSettingsClient *xsettings_client; extern int startup_notifications;
M
src/tint2conf/properties.c
→
src/tint2conf/properties.c
@@ -115,6 +115,7 @@ GtkWidget *launcher_background;
GtkWidget *startup_notifications; IconThemeWrapper *icon_theme; GtkWidget *launcher_tooltip; +GtkWidget *launcher_icon_theme_override; GtkListStore *backgrounds; GtkWidget *current_background,@@ -2152,6 +2153,12 @@ col++;
gtk_tooltips_set_tip(tooltips, launcher_icon_theme, "The icon theme used to display launcher icons. If left blank, " "tint2 will detect and use the icon theme of your desktop as long as you have " "an XSETTINGS manager running (most desktop environments do).", NULL); + + launcher_icon_theme_override = gtk_check_button_new_with_label("Overrides XSETTINGS"); + gtk_widget_show(launcher_icon_theme_override); + gtk_table_attach(GTK_TABLE(table), launcher_icon_theme_override, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); + col++; + gtk_tooltips_set_tip(tooltips, launcher_icon_theme_override, "If enabled, the icon theme selected here will override the one provided by XSETTINGS.", NULL); row++, col = 2; label = gtk_label_new(_("Startup notifications"));
M
src/tint2conf/properties.h
→
src/tint2conf/properties.h
@@ -127,6 +127,7 @@ extern GtkWidget *launcher_background;
extern GtkWidget *startup_notifications; extern IconThemeWrapper *icon_theme; extern GtkWidget *launcher_tooltip; +extern GtkWidget *launcher_icon_theme_override; void load_desktop_file(const char *file, gboolean selected); void set_current_icon_theme(const char *theme);
M
src/tint2conf/properties_rw.c
→
src/tint2conf/properties_rw.c
@@ -469,6 +469,7 @@ fprintf(fp, "launcher_icon_theme = %s\n", icon_theme);
g_free(icon_theme); icon_theme = NULL; } + fprintf(fp, "launcher_icon_theme_override = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(launcher_icon_theme_override)) ? 1 : 0); fprintf(fp, "startup_notifications = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(startup_notifications)) ? 1 : 0); fprintf(fp, "launcher_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(launcher_tooltip)) ? 1 : 0);@@ -1282,6 +1283,9 @@ free(path);
} else if (strcmp(key, "launcher_icon_theme") == 0) { set_current_icon_theme(value); + } + else if (strcmp(key, "launcher_icon_theme_override") == 0) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(launcher_icon_theme_override), atoi(value)); } else if (strcmp(key, "launcher_tooltip") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(launcher_tooltip), atoi(value));