diff options
| author | Silenio Quarti | 2013-03-20 14:30:28 +0000 |
|---|---|---|
| committer | Carolyn MacLeod | 2013-04-09 14:56:44 +0000 |
| commit | 9f7705e0a063815538a8fbffffe1b6d522d9a8e0 (patch) | |
| tree | 062936217db5a3c0fbad7aeb52ba4fa955772386 | |
| parent | cdba6ca36f265bdaa435976a44451b31aa4d2164 (diff) | |
| download | eclipse.platform.swt-9f7705e0a063815538a8fbffffe1b6d522d9a8e0.tar.gz eclipse.platform.swt-9f7705e0a063815538a8fbffffe1b6d522d9a8e0.tar.xz eclipse.platform.swt-9f7705e0a063815538a8fbffffe1b6d522d9a8e0.zip | |
Bug 400339 - Button is clipped to the right
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c | 16 |
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 f3e78ab482..03a8e999a0 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); } |
