launcher: New option launcher_icon_theme_override to preserve legacy behavior

This commit is contained in:
o9000
2015-05-03 10:05:31 +02:00
parent 5486c93f4c
commit a9330b424b
6 changed files with 29 additions and 5 deletions

View File

@@ -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,
@@ -2153,6 +2154,12 @@ void create_launcher(GtkWidget *parent)
"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"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

View File

@@ -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);

View File

@@ -469,6 +469,7 @@ void config_write_launcher(FILE *fp)
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);
@@ -1283,6 +1284,9 @@ void add_entry(char *key, char *value)
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));
}