Permalink
Browse files

Workaround for button UI glitch on 10.14

[#464 state:started]
  • Loading branch information...
Mento committed Sep 14, 2018
1 parent 5f59a92 commit 43ff92cec6db9417a51577e8d51e9d9915169e09
Showing with 8 additions and 1 deletion.
  1. +8 −1 Source/SheetController.m
@@ -415,7 +415,14 @@ - (NSInteger)alertSheetForWindow:(NSWindow *)window
cancelButtonTag = NSAlertFirstButtonReturn;
}

if (cancelButtonTag != 0) {

BOOL isMojave = NO;
if (@available(macOS 10.14, *)) {
// On 10.14 the cancel button hack doesn't work as expected.
isMojave = YES;
}

if (cancelButtonTag != 0 && !isMojave) {
// This is a hack to allow, to close the alert with the escape-key.
[alert addButtonWithTitle:@"Cancel"]; // Add a cancel button. NSAlert sets the key equivalent automatically to esc.
[alert layout]; // Layout the alert, so it's possible to manipulate the layout.

0 comments on commit 43ff92c

Please sign in to comment.