From 92bcb0b8000cd075049006fdb91aada0360630f3 Mon Sep 17 00:00:00 2001 From: Lakshmi Priya Shanmugam Date: Mon, 1 Jul 2019 17:05:09 +0530 Subject: Bug 547030 - [macOS] StyledText link color is wrong in dark mojave mode Make linkForeground static Change-Id: Ib8880bf60a1262bf23a8be67364d2e03e6a8682c --- .../Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java | 9 +++++---- 1 file 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(); -- cgit v1.2.3