From 6dbb4d6384a535bc29ff6c56fcecad50a243564c Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 9 Feb 2012 15:10:21 -0500 Subject: [PATCH] color-widget: don't use a GtkAlignment to center the color editor We can just use a GtkBox, and set hexpand=TRUE/halign=CENTER to allocate the editor in the middle of the box. --- gtk/gtkcolorchooserwidget.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c index 1e0e3a1ddd..8ca633fb5a 100644 --- a/gtk/gtkcolorchooserwidget.c +++ b/gtk/gtkcolorchooserwidget.c @@ -31,7 +31,6 @@ #include "gtkprivate.h" #include "gtkintl.h" #include "gtksizegroup.h" -#include "gtkalignment.h" #include @@ -435,7 +434,6 @@ gtk_color_chooser_widget_init (GtkColorChooserWidget *cc) { GtkWidget *box; GtkWidget *p; - GtkWidget *alignment; GtkWidget *button; GtkWidget *label; gint i; @@ -502,9 +500,12 @@ gtk_color_chooser_widget_init (GtkColorChooserWidget *cc) g_variant_unref (variant); cc->priv->editor = gtk_color_editor_new (); - alignment = gtk_alignment_new (0.5, 0.5, 0, 0); - gtk_container_add (GTK_CONTAINER (cc), alignment); - gtk_container_add (GTK_CONTAINER (alignment), cc->priv->editor); + gtk_widget_set_halign (cc->priv->editor, GTK_ALIGN_CENTER); + gtk_widget_set_hexpand (cc->priv->editor, TRUE); + + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_container_add (GTK_CONTAINER (cc), box); + gtk_container_add (GTK_CONTAINER (box), cc->priv->editor); g_settings_get (cc->priv->settings, "selected-color", "(bdddd)", &selected, @@ -521,7 +522,7 @@ gtk_color_chooser_widget_init (GtkColorChooserWidget *cc) cc->priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); gtk_size_group_add_widget (cc->priv->size_group, cc->priv->palette); - gtk_size_group_add_widget (cc->priv->size_group, alignment); + gtk_size_group_add_widget (cc->priv->size_group, box); } /* GObject implementation {{{1 */