diff options
-rw-r--r-- | platform/darwin/src/MGLAttributionInfo.mm | 7 | ||||
-rw-r--r-- | platform/darwin/test/MGLAttributionInfoTests.m | 2 | ||||
-rw-r--r-- | platform/macos/CHANGELOG.md | 1 |
3 files changed, 8 insertions, 2 deletions
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]; }]; diff --git a/platform/darwin/test/MGLAttributionInfoTests.m b/platform/darwin/test/MGLAttributionInfoTests.m index 74859bda82..e258671c09 100644 --- a/platform/darwin/test/MGLAttributionInfoTests.m +++ b/platform/darwin/test/MGLAttributionInfoTests.m @@ -68,7 +68,7 @@ XCTAssertEqual(infos.count, 1); XCTAssertEqualObjects(infos[0].title.string, @"Mapbox"); - XCTAssertEqualObjects([infos[0].title attribute:NSLinkAttributeName atIndex:0 effectiveRange:nil], [NSURL URLWithString:@"https://www.mapbox.com/"]); + XCTAssertNil([infos[0].title attribute:NSLinkAttributeName atIndex:0 effectiveRange:nil]); XCTAssertEqualObjects([infos[0].title attribute:NSUnderlineStyleAttributeName atIndex:0 effectiveRange:nil], @(NSUnderlineStyleSingle)); #if TARGET_OS_IPHONE diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 152fdc382b..dab02592a5 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -2,6 +2,7 @@ ## master +* Fixed an issue causing attribution button text to appear blue instead of black. ([#8701](https://github.com/mapbox/mapbox-gl-native/pull/8701)) * The error passed into `-[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:]` now includes a more specific description and failure reason. ([#8418](https://github.com/mapbox/mapbox-gl-native/pull/8418)) ## 0.4.0 |