diff options
author | Lakshmi Shanmugam | 2020-03-26 12:59:52 +0000 |
---|---|---|
committer | Lakshmi Shanmugam | 2020-03-27 12:21:51 +0000 |
commit | cddb47ab931ca014a66c20ce86cc57c56d1af49a (patch) | |
tree | 56991760783ba27ba59d6c0a0470cc3551addd39 | |
parent | 8b88fc82d03bef562de9939e270a7c614e1d3761 (diff) | |
download | eclipse.platform.swt-cddb47ab931ca014a66c20ce86cc57c56d1af49a.tar.gz eclipse.platform.swt-cddb47ab931ca014a66c20ce86cc57c56d1af49a.tar.xz eclipse.platform.swt-cddb47ab931ca014a66c20ce86cc57c56d1af49a.zip |
Bug 561235 - Appearance color options table in preferences is flipped
Set the content view height and width only when it it's 0.
Change-Id: Ia9fffa52ba2fb55ee8e70e751c743939797287f2
Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java | 7 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java | 7 |
2 files changed, 8 insertions, 6 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 1bc6d529f2..402e594004 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 @@ -3193,8 +3193,9 @@ void showIndex (int index) { NSTableView tableView = (NSTableView)view; if (tableView.headerView () == null) { /** - * On macOS 10.15, scrollRowToVisible doesn't work properly if + * On macOS 10.15, scrollRowToVisible doesn't work correctly if * contentView's bounds is not set (i.e, width or height is 0). + * * The contentView's bounds is set when the Table's header view is set. * So don't call this code if Table has a header already. */ @@ -3206,8 +3207,8 @@ void showIndex (int index) { if (documentView != null) { NSRect documentViewBounds = documentView.bounds (); NSSize size = new NSSize (); - size.width = documentViewBounds.width; - size.height = documentViewBounds.height; + size.width = contentViewBounds.width == 0 ? documentViewBounds.width : contentViewBounds.width; + size.height = contentViewBounds.height == 0 ? documentViewBounds.height : contentViewBounds.height; contentView.setBoundsSize (size); } } 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 1b6dc796ab..f340f27042 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 @@ -3460,8 +3460,9 @@ void showItem (TreeItem item, boolean scroll) { NSOutlineView outlineView = (NSOutlineView) view; if (outlineView.headerView () == null) { /** - * On macOS 10.15, scrollRowToVisible doesn't work properly if + * On macOS 10.15, scrollRowToVisible doesn't work correctly if * contentView's bounds is not set (i.e, width or height is 0). + * * The contentView's bounds is set when the Tree's header view is set. * So don't call this code if Tree has a header already. */ @@ -3473,8 +3474,8 @@ void showItem (TreeItem item, boolean scroll) { if (documentView != null) { NSRect documentViewBounds = documentView.bounds (); NSSize size = new NSSize (); - size.width = documentViewBounds.width; - size.height = documentViewBounds.height; + size.width = contentViewBounds.width == 0 ? documentViewBounds.width : contentViewBounds.width; + size.height = contentViewBounds.height == 0 ? documentViewBounds.height : contentViewBounds.height; contentView.setBoundsSize (size); } } |