summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.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/ToolBar.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/ToolBar.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index c040f92753..821beed3b0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -389,15 +389,10 @@ int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ eventPtr) {
event.detail = SWT.ARROW;
int /*long*/ topHandle = currentFocusItem.topHandle ();
GtkAllocation allocation = new GtkAllocation ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
- OS.gtk_widget_get_allocation(topHandle, allocation);
- event.x = allocation.x;
- event.y = allocation.y + allocation.height;
- } else {
- event.x = OS.GTK_WIDGET_X (topHandle);
- event.y = OS.GTK_WIDGET_Y (topHandle) + OS.GTK_WIDGET_HEIGHT (topHandle);
- }
- if ((style & SWT.MIRRORED) != 0) event.x = getClientWidth() - OS.GTK_WIDGET_WIDTH(topHandle) - event.x;
+ gtk_widget_get_allocation (topHandle, allocation);
+ event.x = allocation.x;
+ event.y = allocation.y + allocation.height;
+ if ((style & SWT.MIRRORED) != 0) event.x = getClientWidth() - allocation.width - event.x;
currentFocusItem.sendSelectionEvent (SWT.Selection, event, false);
/*
* Stop GTK from processing the event further as key_down binding
@@ -469,16 +464,10 @@ int /*long*/ menuItemSelected (int /*long*/ widget, ToolItem item) {
*/
event.detail = SWT.ARROW;
GtkAllocation allocation = new GtkAllocation ();
- if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
- OS.gtk_widget_get_allocation(widget, allocation);
- event.x = allocation.x;
- if ((style & SWT.MIRRORED) != 0) event.x = getClientWidth () - allocation.width - event.x;
- event.y = allocation.y + allocation.height;
- } else {
- event.x = OS.GTK_WIDGET_X (widget);
- if ((style & SWT.MIRRORED) != 0) event.x = getClientWidth () - OS.GTK_WIDGET_WIDTH (widget) - event.x;
- event.y = OS.GTK_WIDGET_Y (widget) + OS.GTK_WIDGET_HEIGHT (widget);
- }
+ gtk_widget_get_allocation (widget, allocation);
+ event.x = allocation.x;
+ if ((style & SWT.MIRRORED) != 0) event.x = getClientWidth () - allocation.width - event.x;
+ event.y = allocation.y + allocation.height;
break;
case SWT.RADIO :
if ((style & SWT.NO_RADIO_GROUP) == 0) item.selectRadio ();