Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2015-07-02 06:22:54 -0400
committerLakshmi Shanmugam2015-08-05 07:44:32 -0400
commit0162d2abe5b66ccc1e99c41d49e9d6305d85de55 (patch)
treeb580de57c15be110783228835c385cfe8083c7bc
parent68831ebc99a18ffd5d549fab35198b520e890d16 (diff)
downloadeclipse.platform.swt-0162d2abe5b66ccc1e99c41d49e9d6305d85de55.tar.gz
eclipse.platform.swt-0162d2abe5b66ccc1e99c41d49e9d6305d85de55.tar.xz
eclipse.platform.swt-0162d2abe5b66ccc1e99c41d49e9d6305d85de55.zip
Bug 471431 - Problems with Table/Tree with header on OSX 10.10.3.
Revert "Bug 446534 - [10.10] Table/tree with column headers visible has issues on OS X 10.10 Yosemite" This reverts the following commits: 5c5a1960ed4fe39af5c026e122d7c1e5145e25fa. adf7f16f5cf34e63f05f2da0e0bae04f43495e01. f05b4fbf416f2b0b093907de82f9762b4ada1375. e36ad026bcc2ea955980a2ee3df2c148939b95c0.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java48
2 files changed, 3 insertions, 91 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
index 1de327924f..518e5eedcd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
@@ -79,7 +79,7 @@ public class Table extends Composite {
Rectangle imageBounds;
/* Used to control drop feedback when FEEDBACK_SCROLL is set/not set */
- boolean shouldScroll = true, fixOrigin;
+ boolean shouldScroll = true;
static int NEXT_ID;
@@ -1169,10 +1169,6 @@ void drawWithExpansionFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect ce
void drawRect(long /*int*/ id, long /*int*/ sel, NSRect rect) {
fixScrollWidth = false;
- if (fixOrigin) {
- fixOrigin = false;
- fixTableOrigin();
- }
super.drawRect(id, sel, rect);
if (isDisposed ()) return;
if (fixScrollWidth) {
@@ -1778,16 +1774,7 @@ public int getTopIndex () {
point.x = rect.x;
point.y = rect.y;
- NSTableView tableView = (NSTableView)view;
- /*
- * Note: On OSX 10.10, in setBounds(), we reset the origin of NSTableView so that it is
- * positioned below the header view. Take this into account before calling rowAtPoint().
- */
- if ((tableView.headerView() != null) && (OS.VERSION_MMB >= OS.VERSION_MMB(10, 10, 0))) {
- NSRect headerRect = headerView.frame();
- point.y += headerRect.y + headerRect.height;
- }
- int /*64*/ rowAtPoint = (int)/*64*/(tableView).rowAtPoint(point);
+ int /*64*/ rowAtPoint = (int)/*64*/((NSTableView)view).rowAtPoint(point);
if (rowAtPoint == -1) return 0; /* Empty table */
return rowAtPoint;
}
@@ -2444,26 +2431,6 @@ void setBackgroundColor(NSColor nsColor) {
((NSTableView) view).setBackgroundColor (nsColor);
}
-void fixTableOrigin () {
- /*
- * Bug on OSX 10.10: The scrollview's content view and the table's header view have the same origin.
- * This causes the first row of the NSTableView to be hidden by header view.
- * Set the origin of NSTableView so that it is positioned below the header view.
- */
- NSTableView tableView = (NSTableView) view;
- if ((OS.VERSION_MMB >= OS.VERSION_MMB (10, 10, 0))) {
- NSPoint pt = new NSPoint ();
- NSRect headerRect = headerView.frame ();
- if (tableView.headerView () != null) {
- pt.y = headerRect.y + headerRect.height;
- } else {
- pt.y = 0;
- }
- view.setFrameOrigin (pt);
- view.setNeedsDisplay (true);
- }
-}
-
/**
* Sets the order that the items in the receiver should
* be displayed in to the given argument which is described
@@ -2562,7 +2529,6 @@ void setFont (NSFont font) {
*/
public void setHeaderVisible (boolean show) {
checkWidget ();
- fixOrigin = true;
((NSTableView)view).setHeaderView (show ? headerView : null);
scrollView.tile();
}
@@ -2984,14 +2950,6 @@ public void setTopIndex (int index) {
NSPoint pt = new NSPoint();
pt.x = scrollView.contentView().bounds().x;
pt.y = widget.frameOfCellAtColumn(0, row).y;
- /*
- * Note: On OSX 10.10, in setBounds(), we reset the origin of NSTableView so that it is
- * positioned below the header view. Take this into account before calling scrollPoint().
- */
- if ((widget.headerView() != null) && (OS.VERSION_MMB >= OS.VERSION_MMB(10, 10, 0))) {
- NSRect headerRect = headerView.frame();
- pt.y -= headerRect.y + headerRect.height;
- }
view.scrollPoint(pt);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
index de931fc3d9..bbfd033fc3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
@@ -90,7 +90,7 @@ public class Tree extends Composite {
boolean insertBefore;
/* Used to control drop feedback when DND.FEEDBACK_EXPAND and DND.FEEDBACK_SCROLL is set/not set */
- boolean shouldExpand = true, shouldScroll = true, fixOrigin;
+ boolean shouldExpand = true, shouldScroll = true;
static int NEXT_ID;
@@ -1244,15 +1244,6 @@ void drawInteriorWithFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect rec
}
}
-@Override
-void drawRect (long /*int*/ id, long /*int*/ sel, NSRect /*int*/ rect) {
- if (fixOrigin) {
- fixOrigin = false;
- fixTreeOrigin ();
- }
- super.drawRect (id, sel, rect);
-}
-
void drawWithExpansionFrame_inView (long /*int*/ id, long /*int*/ sel, NSRect cellFrame, long /*int*/ view) {
drawExpansion = true;
super.drawWithExpansionFrame_inView(id, sel, cellFrame, view);
@@ -1849,14 +1840,6 @@ public TreeItem getTopItem () {
point.x = rect.x;
point.y = rect.y;
NSOutlineView outlineView = (NSOutlineView)view;
- /*
- * Note: On OSX 10.10, in setBounds(), we reset the origin of NSOutlineView so that it is
- * positioned below the header view. Take this into account before calling rowAtPoint().
- */
- if ((outlineView.headerView() != null) && (OS.VERSION_MMB >= OS.VERSION_MMB(10, 10, 0))) {
- NSRect headerRect = headerView.frame();
- point.y += headerRect.y + headerRect.height;
- }
long /*int*/ index = outlineView.rowAtPoint (point);
if (index == -1) return null; /* empty */
id item = outlineView.itemAtRow (index);
@@ -2714,26 +2697,6 @@ void setBackgroundColor(NSColor nsColor) {
((NSTableView) view).setBackgroundColor (nsColor);
}
-void fixTreeOrigin () {
- /*
- * Bug on OSX 10.10: The scrollview's content view and the tree's header view have the same origin.
- * This causes the first row of the NSOutlineView to be hidden by header view.
- * Set the origin of NSOutlineView so that it is positioned below the header view.
- */
- NSOutlineView widget = (NSOutlineView) view;
- if (OS.VERSION_MMB >= OS.VERSION_MMB (10, 10, 0)) {
- NSPoint pt = new NSPoint();
- NSRect headerRect = headerView.frame ();
- if (widget.headerView() != null) {
- pt.y = headerRect.y + headerRect.height;
- } else {
- pt.y = 0;
- }
- view.setFrameOrigin (pt);
- view.setNeedsDisplay (true);
- }
-}
-
/**
* Sets the order that the items in the receiver should
* be displayed in to the given argument which is described
@@ -2835,7 +2798,6 @@ void setFont (NSFont font) {
*/
public void setHeaderVisible (boolean show) {
checkWidget ();
- fixOrigin = true;
((NSOutlineView) view).setHeaderView (show ? headerView : null);
scrollView.tile();
}
@@ -3192,14 +3154,6 @@ public void setTopItem (TreeItem item) {
NSPoint pt = new NSPoint();
pt.x = scrollView.contentView().bounds().x;
pt.y = widget.frameOfCellAtColumn(0, row).y;
- /*
- * Note: On OSX 10.10, in setBounds(), we reset the origin of NSOutlineView so that it is
- * positioned below the header view. Take this into account before calling scrollPoint().
- */
- if ((widget.headerView() != null) && (OS.VERSION_MMB >= OS.VERSION_MMB(10, 10, 0))) {
- NSRect headerRect = headerView.frame();
- pt.y -= headerRect.y + headerRect.height;
- }
view.scrollPoint(pt);
}

Back to the top