[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.
This commit is contained in:
committed by
Minh Nguyễn
parent
e10360f34a
commit
f300a8fedc
@@ -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
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user