From 6a0c4e0142ef44d7c9f3f05e9a7ddfed985809ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 10 Apr 2017 14:56:25 -0700 Subject: [macos] Remove link attribute from attribution text Fixed an issue causing the attribution button text to appear blue instead of black. On macOS 10.12 and above, hyperlinks in attributed strings are blue regardless of any color attributes applied to the same run of text. --- platform/darwin/src/MGLAttributionInfo.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'platform/darwin/src') diff --git a/platform/darwin/src/MGLAttributionInfo.mm b/platform/darwin/src/MGLAttributionInfo.mm index fa2ae787a5..7583244491 100644 --- a/platform/darwin/src/MGLAttributionInfo.mm +++ b/platform/darwin/src/MGLAttributionInfo.mm @@ -93,7 +93,12 @@ return; } - MGLAttributionInfo *info = [[MGLAttributionInfo alloc] initWithTitle:title URL:value]; + // Remove the link, because it forces the text to be blue on macOS 10.12 + // and above. + NSMutableAttributedString *unlinkedTitle = [title mutableCopy]; + [unlinkedTitle removeAttribute:NSLinkAttributeName range:unlinkedTitle.mgl_wholeRange]; + + MGLAttributionInfo *info = [[MGLAttributionInfo alloc] initWithTitle:unlinkedTitle URL:value]; info.feedbackLink = isFeedbackLink; [infos addObject:info]; }]; -- cgit v1.2.1