[gtk+/wip/colorchooser-v2: 71/77] color-editor: don't use a GtkAlignment to layout popups



commit 533020865d2c7b148a80928d645d9ade28b754ac
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Feb 9 14:25:53 2012 -0500

    color-editor: don't use a GtkAlignment to layout popups
    
    Set a margin on the contents and use a box instead.

 gtk/gtkcoloreditor.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcoloreditor.c b/gtk/gtkcoloreditor.c
index bcf4757..923c272 100644
--- a/gtk/gtkcoloreditor.c
+++ b/gtk/gtkcoloreditor.c
@@ -44,7 +44,6 @@
 #include "gtkadjustment.h"
 #include "gtklabel.h"
 #include "gtkspinbutton.h"
-#include "gtkalignment.h"
 #include "gtkintl.h"
 
 #include <math.h>
@@ -352,14 +351,13 @@ create_popup (GtkColorEditor *editor,
 {
   GtkWidget *popup;
 
-  popup = gtk_alignment_new (0.5, 0.5, 0, 0);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (popup), 12, 12, 12, 12);
-  gtk_style_context_add_class (gtk_widget_get_style_context (popup), GTK_STYLE_CLASS_TOOLTIP);
+  g_object_set (contents, "margin", 12, NULL);
 
+  popup = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_style_context_add_class (gtk_widget_get_style_context (popup), GTK_STYLE_CLASS_TOOLTIP);
   gtk_container_add (GTK_CONTAINER (popup), contents);
 
-  gtk_widget_show_all (popup);
-  gtk_widget_hide (popup);
+  gtk_widget_show_all (contents);
   gtk_widget_set_no_show_all (popup, TRUE);
 
   g_signal_connect (popup, "draw", G_CALLBACK (popup_draw), editor);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]