summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorEimantas Vaiciunas <eimantas@walkingsmarts.com>2017-04-02 14:35:24 +0300
committerMinh Nguyễn <mxn@1ec5.org>2017-04-03 21:44:14 -0700
commit4a4b6a8af306691588602fbc6f3ed17c5f193355 (patch)
tree516adcc7fa0e63df9f0c488b26714f422f312955 /platform
parentb5b4549b6d80e4a1f45e766161bafd52a064c91d (diff)
downloadqtlocation-mapboxgl-4a4b6a8af306691588602fbc6f3ed17c5f193355.tar.gz
Show zoom level in window's title bar
Diffstat (limited to 'platform')
-rw-r--r--platform/macos/app/Base.lproj/MapDocument.xib15
-rw-r--r--platform/macos/app/MapDocument.m7
2 files changed, 15 insertions, 7 deletions
diff --git a/platform/macos/app/Base.lproj/MapDocument.xib b/platform/macos/app/Base.lproj/MapDocument.xib
index b658b52cc2..065acc41fd 100644
--- a/platform/macos/app/Base.lproj/MapDocument.xib
+++ b/platform/macos/app/Base.lproj/MapDocument.xib
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12118"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -48,7 +48,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="388" y="211" width="642" height="480"/>
- <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
+ <rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
<view key="contentView" id="TuG-C5-zLS">
<rect key="frame" x="0.0" y="0.0" width="642" height="480"/>
<autoresizingMask key="autoresizingMask"/>
@@ -240,12 +240,17 @@
</connections>
</toolbar>
<connections>
- <binding destination="-2" name="displayPatternTitle1" keyPath="mapView.centerCoordinate" id="wtz-AV-bG1">
+ <binding destination="-2" name="displayPatternTitle1" keyPath="mapView.centerCoordinate" id="p1k-yo-4Nb">
<dictionary key="options">
- <string key="NSDisplayPattern">%{title1}@</string>
+ <string key="NSDisplayPattern">%{title1}@ @ %{title2}@</string>
<string key="NSValueTransformerName">LocationCoordinate2DTransformer</string>
</dictionary>
</binding>
+ <binding destination="-2" name="displayPatternTitle2" keyPath="mapView.zoomLevel" previousBinding="p1k-yo-4Nb" id="HBB-y3-89c">
+ <dictionary key="options">
+ <string key="NSDisplayPattern">%{title1}@ @ %{title2}@</string>
+ </dictionary>
+ </binding>
<outlet property="delegate" destination="-2" id="HEo-Qf-o6o"/>
</connections>
</window>
diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m
index ec90888084..5be17c1cbe 100644
--- a/platform/macos/app/MapDocument.m
+++ b/platform/macos/app/MapDocument.m
@@ -156,7 +156,7 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
#pragma mark View methods
- (IBAction)showStyle:(id)sender {
- NSInteger tag;
+ NSInteger tag = -1;
if ([sender isKindOfClass:[NSMenuItem class]]) {
tag = [sender tag];
} else if ([sender isKindOfClass:[NSPopUpButton class]]) {
@@ -424,8 +424,11 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
// Temporarily set the display name to the default center coordinate instead
// of “Untitled” until the binding kicks in.
NSValue *coordinateValue = [NSValue valueWithMGLCoordinate:self.mapView.centerCoordinate];
- self.displayName = [[NSValueTransformer valueTransformerForName:@"LocationCoordinate2DTransformer"]
+ NSString *coordinateString = [[NSValueTransformer valueTransformerForName:@"LocationCoordinate2DTransformer"]
transformedValue:coordinateValue];
+
+
+ self.displayName = [NSString stringWithFormat:@"%@ @ %f", coordinateString, _mapView.zoomLevel];
}
#pragma mark Debug methods