diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c | 51 |
1 files changed, 47 insertions, 4 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..713106a2ca 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 @@ -504,13 +504,56 @@ static void swt_fixed_map (GtkWidget *widget) { } static void swt_fixed_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) { - if (minimum) *minimum = 0; - if (natural) *natural = 0; + if (GTK_CHECK_VERSION(3,0,0)){ + SwtFixed *fixed = SWT_FIXED (widget); + SwtFixedPrivate *priv = fixed->priv; + GList *list; + GtkRequisition min_requisition, nat_requisition; + + list = priv->children; + + while (list) { + SwtFixedChild *child_data = list->data; + GtkWidget *child = child_data->widget; + list = list->next; + + gtk_widget_get_preferred_size (child, &min_requisition, &nat_requisition); + *minimum = child_data->x; + *natural = child_data->x; + *minimum += min_requisition.width; + *natural += nat_requisition.width; + } + }else{ + if (minimum) *minimum = 0; + if (natural) *natural = 0; + } } static void swt_fixed_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) { - if (minimum) *minimum = 0; - if (natural) *natural = 0; + if (GTK_CHECK_VERSION(3,0,0)){ + SwtFixed *fixed = SWT_FIXED (widget); + SwtFixedPrivate *priv = fixed->priv; + GList *list; + GtkRequisition min_requisition, nat_requisition; + + list = priv->children; + + while (list) { + SwtFixedChild *child_data = list->data; + GtkWidget *child = child_data->widget; + list = list->next; + + gtk_widget_get_preferred_size (child, &min_requisition, &nat_requisition); + + *minimum = child_data->y; + *natural = child_data->y; + *minimum += min_requisition.height; + *natural += nat_requisition.height; + } + }else{ + if (minimum) *minimum = 0; + if (natural) *natural = 0; + } } static void swt_fixed_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { |