]> Pileus Git - ~andy/gtk/commitdiff
GtkColorChooserWidget: deselect swatch before removing palettes
authorMichael Hofmann <mh21@mh21.de>
Sun, 17 Feb 2013 15:01:06 +0000 (16:01 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 4 Mar 2013 23:32:00 +0000 (18:32 -0500)
When adding custom palettes, set the current swatch to NULL if the
palette it is on is going to be removed.

https://bugzilla.gnome.org/show_bug.cgi?id=693995

gtk/gtkcolorchooserwidget.c

index be954a26687421d4800fd072c85f3380afb7a534..8e6cf2c82e78506d8cdf72e1aa032b3c4d91b01e 100644 (file)
@@ -296,6 +296,10 @@ remove_palette (GtkColorChooserWidget *cc)
   GList *children, *l;
   GtkWidget *widget;
 
+  if (cc->priv->current != NULL &&
+      gtk_widget_get_parent (GTK_WIDGET (cc->priv->current)) != cc->priv->custom)
+    cc->priv->current = NULL;
+
   children = gtk_container_get_children (GTK_CONTAINER (cc->priv->palette));
   for (l = children; l; l = l->next)
     {