tint2conf: disable buttons for gradient/background 0
o9000 mrovi9000@gmail.com
3 files changed,
29 insertions(+),
3 deletions(-)
M
src/systray/systraybar.c
→
src/systray/systraybar.c
@@ -586,7 +586,7 @@ }
gboolean reject_icon(Window win) { - if (systray_hide_name_filter) { + if (systray_hide_name_filter && strlen(systray_hide_name_filter)) { if (!systray_hide_name_regex) { systray_hide_name_regex = (regex_t *) calloc(1, sizeof(*systray_hide_name_regex)); if (regcomp(systray_hide_name_regex, systray_hide_name_filter, 0) != 0) {
M
src/tint2conf/background_gui.c
→
src/tint2conf/background_gui.c
@@ -846,6 +846,23 @@ int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_background));
if (index < 0) return; + gtk_widget_set_sensitive(gradient_combo_type, index > 0); + gtk_widget_set_sensitive(background_fill_color, index > 0); + gtk_widget_set_sensitive(background_border_color, index > 0); + gtk_widget_set_sensitive(background_gradient, index > 0); + gtk_widget_set_sensitive(background_fill_color_over, index > 0); + gtk_widget_set_sensitive(background_border_color_over, index > 0); + gtk_widget_set_sensitive(background_gradient_over, index > 0); + gtk_widget_set_sensitive(background_fill_color_press, index > 0); + gtk_widget_set_sensitive(background_border_color_press, index > 0); + gtk_widget_set_sensitive(background_gradient_press, index > 0); + gtk_widget_set_sensitive(background_border_width, index > 0); + gtk_widget_set_sensitive(background_border_sides_top, index > 0); + gtk_widget_set_sensitive(background_border_sides_bottom, index > 0); + gtk_widget_set_sensitive(background_border_sides_left, index > 0); + gtk_widget_set_sensitive(background_border_sides_right, index > 0); + gtk_widget_set_sensitive(background_corner_radius, index > 0); + background_updates_disabled = TRUE; GtkTreePath *path;
M
src/tint2conf/gradient_gui.c
→
src/tint2conf/gradient_gui.c
@@ -208,7 +208,7 @@ gtk_list_store_append(gradient_ids, &iter);
gtk_list_store_set(gradient_ids, &iter, grColPixbuf, NULL, grColId, &index, - grColText, "", + grColText, index == 0 ? _("None") : "", -1); gradient_update_image(index);@@ -239,6 +239,8 @@ int index = get_model_length(GTK_TREE_MODEL(gradient_ids));
GradientConfig *g = (GradientConfig *)calloc(1, sizeof(GradientConfig)); g->type = g_old->type; + g->start_color = g_old->start_color; + g->end_color = g_old->end_color; g->extra_color_stops = g_list_copy_deep(g->extra_color_stops, copy_GradientConfigColorStop, NULL); gradients = g_list_append(gradients, g); GtkTreeIter iter;@@ -352,7 +354,7 @@ {
if (gradient_updates_disabled) return; int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient)); - if (index < 0) + if (index <= 0) return; GtkTreePath *path;@@ -393,6 +395,13 @@ {
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient)); if (index < 0) return; + + gtk_widget_set_sensitive(gradient_combo_type, index > 0); + gtk_widget_set_sensitive(gradient_start_color, index > 0); + gtk_widget_set_sensitive(gradient_end_color, index > 0); + gtk_widget_set_sensitive(current_gradient_stop, index > 0); + gtk_widget_set_sensitive(gradient_stop_color, index > 0); + gtk_widget_set_sensitive(gradient_stop_offset, index > 0); gradient_updates_disabled = TRUE;