aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2013-03-20 10:30:28 (EDT)
committerCarolyn MacLeod2013-04-09 10:56:44 (EDT)
commit9f7705e0a063815538a8fbffffe1b6d522d9a8e0 (patch)
tree062936217db5a3c0fbad7aeb52ba4fa955772386
parentcdba6ca36f265bdaa435976a44451b31aa4d2164 (diff)
downloadeclipse.platform.swt-9f7705e0a063815538a8fbffffe1b6d522d9a8e0.zip
eclipse.platform.swt-9f7705e0a063815538a8fbffffe1b6d522d9a8e0.tar.gz
eclipse.platform.swt-9f7705e0a063815538a8fbffffe1b6d522d9a8e0.tar.bz2
Bug 400339 - Button is clipped to the right
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
index f3e78ab..03a8e99 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
@@ -519,6 +519,7 @@ static void swt_fixed_size_allocate (GtkWidget *widget, GtkAllocation *allocatio
GList *list;
GtkAllocation child_allocation;
GtkRequisition requisition;
+ gint w, h;
gtk_widget_set_allocation (widget, allocation);
@@ -542,9 +543,18 @@ static void swt_fixed_size_allocate (GtkWidget *widget, GtkAllocation *allocatio
child_allocation.y += allocation->y;
}
- gtk_widget_get_preferred_size (child, &requisition, NULL);
- child_allocation.width = requisition.width;
- child_allocation.height = requisition.height;
+ /*
+ * Use the requested size if it is set. This is the GTK 2 behavior of
+ * gtk_widget_get_child_requisition().
+ */
+ gtk_widget_get_size_request (child, &w, &h);
+ if (w == -1 || h == -1) {
+ gtk_widget_get_preferred_size (child, &requisition, NULL);
+ if (w == -1) w = requisition.width;
+ if (h == -1) h = requisition.height;
+ }
+ child_allocation.width = w;
+ child_allocation.height = h;
gtk_widget_size_allocate (child, &child_allocation);
}