diff options
| author | Lakshmi Priya Shanmugam | 2019-07-01 11:35:09 +0000 |
|---|---|---|
| committer | Lakshmi Priya Shanmugam | 2019-07-01 12:09:18 +0000 |
| commit | 92bcb0b8000cd075049006fdb91aada0360630f3 (patch) | |
| tree | 776ae0eab64ec61621345de7a8e82826ba4b55e9 | |
| parent | 5c60fc6d1def122d379b69dbd5f1417347c05175 (diff) | |
| download | eclipse.platform.swt-92bcb0b8000cd075049006fdb91aada0360630f3.tar.gz eclipse.platform.swt-92bcb0b8000cd075049006fdb91aada0360630f3.tar.xz eclipse.platform.swt-92bcb0b8000cd075049006fdb91aada0360630f3.zip | |
Bug 547030 - [macOS] StyledText link color is wrong in dark mojave mode
Make linkForeground static
Change-Id: Ib8880bf60a1262bf23a8be67364d2e03e6a8682c
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java index d61d25519d..b0db013535 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java @@ -54,7 +54,6 @@ public final class TextLayout extends Resource { int wrapWidth; int orientation; private double defaultTabWidth; - NSColor linkForeground; int[] lineOffsets; NSRect[] lineBounds; @@ -69,6 +68,8 @@ public final class TextLayout extends Resource { private boolean ignoreSegments; static final char LTR_MARK = '\u200E', RTL_MARK = '\u200F'; + static NSColor linkForeground; + static class StyleItem { TextStyle style; int start; @@ -267,7 +268,7 @@ void computeRuns() { case SWT.UNDERLINE_LINK: { underlineStyle = OS.NSUnderlineStyleSingle; if (foreground == null) { - NSColor color = getLinkColor(); + NSColor color = getLinkForeground(); attrStr.addAttribute(OS.NSForegroundColorAttributeName, color, range); } break; @@ -1059,9 +1060,9 @@ public FontMetrics getLineMetrics (int lineIndex) { } } -NSColor getLinkColor() { +NSColor getLinkForeground() { if (linkForeground == null) { - /** + /* * Color used is same as SWT.COLOR_LINK_FOREGROUND computed in Display.getWidgetColorRGB() */ NSTextView textView = (NSTextView)new NSTextView().alloc(); |
