summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-27 15:37:40 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-27 15:38:42 -0400
commit9effcc166dfa61e54b0f9bb76b17f1175f53b69b (patch)
tree4067e33bd1e51787f534cc6d4887914a337e4961 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
parenta3a1752d4cca52a10819bc086957df9ad04a0a87 (diff)
downloadeclipse.platform.swt-9effcc166dfa61e54b0f9bb76b17f1175f53b69b.tar.gz
eclipse.platform.swt-9effcc166dfa61e54b0f9bb76b17f1175f53b69b.tar.xz
eclipse.platform.swt-9effcc166dfa61e54b0f9bb76b17f1175f53b69b.zip
Bug 386401 - Use gtk_widget_get_allocation in newer GTK+
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java21
1 files changed, 5 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
index ed57668988..8a5b3fcde0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
@@ -150,23 +150,12 @@ void destroyWidget () {
*/
public Rectangle getBounds () {
checkWidget();
- int x = 0;
- int y = 0;
- int width = 0;
- int height = 0;
GtkAllocation allocation = new GtkAllocation ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
- OS.gtk_widget_get_allocation(handle, allocation);
- x = allocation.x;
- y = allocation.y;
- width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
- height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height;
- } else {
- x = OS.GTK_WIDGET_X (handle);
- y = OS.GTK_WIDGET_Y (handle);
- width = (state & ZERO_WIDTH) != 0 ? 0 : OS.GTK_WIDGET_WIDTH (handle);
- height = (state & ZERO_HEIGHT) != 0 ? 0 : OS.GTK_WIDGET_HEIGHT (handle);
- }
+ gtk_widget_get_allocation (handle, allocation);
+ int x = allocation.x;
+ int y = allocation.y;
+ int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
+ int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height;
if ((parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - width - x;
return new Rectangle (x, y, width, height);
}