[gtk+/kill-size-request] Use gtk_widget_set_size_request() instead of handling "size-request" signals.



commit 6e22c646c6dcd4349c183e4b76efd7ab785bff22
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Thu Oct 28 14:56:04 2010 +0900

    Use gtk_widget_set_size_request() instead of handling "size-request" signals.

 gtk/gtktoolitemgroup.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 2f69c08..0f11b29 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -308,15 +308,6 @@ gtk_tool_item_group_header_draw_cb (GtkWidget *widget,
 }
 
 static void
-gtk_tool_item_group_header_size_request_cb (GtkWidget      *widget,
-                                            GtkRequisition *requisition,
-                                            gpointer        data)
-{
-  GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (data);
-  requisition->height = MAX (requisition->height, group->priv->expander_size);
-}
-
-static void
 gtk_tool_item_group_header_clicked_cb (GtkButton *button,
                                        gpointer   data)
 {
@@ -344,6 +335,8 @@ gtk_tool_item_group_header_adjust_style (GtkToolItemGroup *group)
                         "header-spacing", &(priv->header_spacing),
                         "expander-size", &(priv->expander_size),
                         NULL);
+  
+  gtk_widget_set_size_request (alignment, -1, priv->expander_size);
 
   switch (gtk_tool_shell_get_orientation (GTK_TOOL_SHELL (group)))
     {
@@ -412,9 +405,6 @@ gtk_tool_item_group_init (GtkToolItemGroup *group)
   g_signal_connect_after (alignment, "draw",
                           G_CALLBACK (gtk_tool_item_group_header_draw_cb),
                           group);
-  g_signal_connect_after (alignment, "size-request",
-                          G_CALLBACK (gtk_tool_item_group_header_size_request_cb),
-                          group);
 
   g_signal_connect (priv->header, "clicked",
                     G_CALLBACK (gtk_tool_item_group_header_clicked_cb),



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