Commit a1332167 authored by Matthias Clasen's avatar Matthias Clasen

color chooser: Reset show-editor on unmap

We have a testcolorchooser test, with a --edit option. It was
supposed to make the color chooser come up in edit mode, but
it didn't work ever since we dropped the ::response handler.
Fix it by resetting show-editor on unmap, instead of on map.
This way, users can set show-editor before showing the dialog,
and it will take effect.
parent 4a8ff565
......@@ -119,16 +119,14 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
gtk_color_chooser_dialog_map (GtkWidget *widget)
gtk_color_chooser_dialog_unmap (GtkWidget *widget)
{
GTK_WIDGET_CLASS (gtk_color_chooser_dialog_parent_class)->unmap (widget);
/* We never want the dialog to come up with the editor,
* even if it was showing the editor the last time it was used.
*/
g_object_set (GTK_COLOR_CHOOSER_DIALOG (widget)->priv->chooser,
"show-editor", FALSE,
NULL);
GTK_WIDGET_CLASS (gtk_color_chooser_dialog_parent_class)->map (widget);
g_object_set (widget, "show-editor", FALSE, NULL);
}
static void
......@@ -207,7 +205,7 @@ gtk_color_chooser_dialog_class_init (GtkColorChooserDialogClass *class)
object_class->get_property = gtk_color_chooser_dialog_get_property;
object_class->set_property = gtk_color_chooser_dialog_set_property;
widget_class->map = gtk_color_chooser_dialog_map;
widget_class->unmap = gtk_color_chooser_dialog_unmap;
g_object_class_override_property (object_class, PROP_RGBA, "rgba");
g_object_class_override_property (object_class, PROP_USE_ALPHA, "use-alpha");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment