diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-01-27 00:49:39 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-01-27 09:14:02 -0800 |
commit | f300a8fedc6ea2078ad9f03cba7620f283570716 (patch) | |
tree | 9c23147c3bbe9774930cf2e67f7e794eed6c9373 /platform/macos/app | |
parent | e10360f34a581347a6af685b21662ff5c5341cb3 (diff) | |
download | qtlocation-mapboxgl-f300a8fedc6ea2078ad9f03cba7620f283570716.tar.gz |
[macos] Take focus from access token field on close
When closing the Preferences window, take focus away from the Access Token text field to force any changes to be committed.
Diffstat (limited to 'platform/macos/app')
-rw-r--r-- | platform/macos/app/AppDelegate.m | 11 | ||||
-rw-r--r-- | platform/macos/app/Base.lproj/MainMenu.xib | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/platform/macos/app/AppDelegate.m b/platform/macos/app/AppDelegate.m index d3fe2d204e..85b44da1cc 100644 --- a/platform/macos/app/AppDelegate.m +++ b/platform/macos/app/AppDelegate.m @@ -71,7 +71,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; @end -@interface AppDelegate () +@interface AppDelegate () <NSWindowDelegate> @property (weak) IBOutlet NSArrayController *offlinePacksArrayController; @property (weak) IBOutlet NSPanel *offlinePacksPanel; @@ -283,4 +283,13 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; return NO; } +#pragma mark NSWindowDelegate methods + +- (void)windowWillClose:(NSNotification *)notification { + NSWindow *window = notification.object; + if (window == self.preferencesWindow) { + [window makeFirstResponder:nil]; + } +} + @end diff --git a/platform/macos/app/Base.lproj/MainMenu.xib b/platform/macos/app/Base.lproj/MainMenu.xib index 9faf1ba04b..d416ea9f28 100644 --- a/platform/macos/app/Base.lproj/MainMenu.xib +++ b/platform/macos/app/Base.lproj/MainMenu.xib @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11191" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11191"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"> @@ -703,6 +704,7 @@ CA </constraints> </view> <connections> + <outlet property="delegate" destination="Voe-Tx-rLC" id="PNO-Pp-jOX"/> <outlet property="initialFirstResponder" destination="7sb-sf-oJU" id="UZe-di-dnA"/> </connections> <point key="canvasLocation" x="754" y="221"/> |