Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSnjezana Peco2015-05-10 22:17:05 +0000
committerAlexander Kurtakov2015-05-12 16:57:36 +0000
commitd2af9778a61685fac23a2f74ff7d7c90b2c69ed4 (patch)
tree1b02a69e5eccaab1990acca397d75f362b51caf0
parent002548a3384e2694fac2c5d950888a8eea47f229 (diff)
downloadeclipse.platform.swt-d2af9778a61685fac23a2f74ff7d7c90b2c69ed4.tar.gz
eclipse.platform.swt-d2af9778a61685fac23a2f74ff7d7c90b2c69ed4.tar.xz
eclipse.platform.swt-d2af9778a61685fac23a2f74ff7d7c90b2c69ed4.zip
Bug 438505 - [GTK3] Problem with table editing
Change-Id: I30c9caaa1b71547eb4c762f4f074b0dadf719e26 Signed-off-by: Snjezana Peco <snjeza.peco@gmail.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java6
4 files changed, 29 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index cd9cb94e22..7f6f1edabe 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -1155,7 +1155,11 @@ public Rectangle getClientArea () {
OS.gtk_widget_get_allocation (clientHandle, allocation);
int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height;
- return new Rectangle (fixedX [0] - binX [0], fixedY [0] - binY [0], width, height);
+ Rectangle rect = new Rectangle (fixedX [0] - binX [0], fixedY [0] - binY [0], width, height);
+ if (getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
+ rect.y += getHeaderHeight();
+ }
+ return rect;
}
@Override
@@ -2205,6 +2209,10 @@ boolean mnemonicMatch (char key) {
@Override
long /*int*/ paintWindow () {
OS.gtk_widget_realize (handle);
+ if (fixedHandle != 0 && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
+ OS.gtk_widget_realize (fixedHandle);
+ return OS.gtk_widget_get_window(fixedHandle);
+ }
return OS.gtk_tree_view_get_bin_window (handle);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 468730659d..22fd786153 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -12,9 +12,9 @@ package org.eclipse.swt.widgets;
import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.gtk.*;
-import org.eclipse.swt.graphics.*;
/**
* Instances of this class represent a selectable user interface object
@@ -372,7 +372,11 @@ public Rectangle getBounds (int index) {
rect.width -= x [0] + w [0];
}
int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
- return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+ Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
+ if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
+ r.y += parent.getHeaderHeight();
+ }
+ return r;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 7b88efe482..871e8e049c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -1147,7 +1147,11 @@ public Rectangle getClientArea () {
OS.gtk_widget_get_allocation (clientHandle, allocation);
int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height;
- return new Rectangle (fixedX [0] - binX [0], fixedY [0] - binY [0], width, height);
+ Rectangle rect = new Rectangle (fixedX [0] - binX [0], fixedY [0] - binY [0], width, height);
+ if (getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
+ rect.y += getHeaderHeight();
+ }
+ return rect;
}
@Override
@@ -2303,6 +2307,10 @@ boolean mnemonicMatch (char key) {
@Override
long /*int*/ paintWindow () {
OS.gtk_widget_realize (handle);
+ if (fixedHandle != 0 && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
+ OS.gtk_widget_realize (fixedHandle);
+ return OS.gtk_widget_get_window(fixedHandle);
+ }
return OS.gtk_tree_view_get_bin_window (handle);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index 502d38a655..824f2f5ce0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -447,7 +447,11 @@ public Rectangle getBounds (int index) {
rect.width -= x [0] + w [0];
}
int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
- return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+ Rectangle r = new Rectangle (rect.x, rect.y, width, rect.height + 1);
+ if (parent.getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
+ r.y += parent.getHeaderHeight();
+ }
+ return r;
}
/**

Back to the top