diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java index b4a341f417..7649674a1a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java @@ -752,17 +752,10 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize * resized so that it will draw wrapped. */ if (wrap) { - int boxWidth = 0; - int boxHeight = 0; GtkAllocation allocation = new GtkAllocation(); - if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { - OS.gtk_widget_get_allocation(boxHandle, allocation); - boxWidth = allocation.width; - boxHeight = allocation.height; - } else { - boxWidth = OS.GTK_WIDGET_WIDTH (boxHandle); - boxHeight = OS.GTK_WIDGET_HEIGHT (boxHandle); - } + gtk_widget_get_allocation (boxHandle, allocation); + int boxWidth = allocation.width; + int boxHeight = allocation.height; int /*long*/ labelLayout = OS.gtk_label_get_layout (labelHandle); int pangoWidth = OS.pango_layout_get_width (labelLayout); OS.pango_layout_set_width (labelLayout, -1); @@ -785,12 +778,6 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize */ GtkRequisition requisition = new GtkRequisition (); OS.gtk_widget_size_request (boxHandle, requisition); - if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { - OS.gtk_widget_get_allocation(boxHandle, allocation); - } else { - allocation.x = OS.GTK_WIDGET_X (boxHandle); - allocation.y = OS.GTK_WIDGET_Y (boxHandle); - } allocation.width = boxWidth; allocation.height = boxHeight; OS.gtk_widget_size_allocate (boxHandle, allocation); |