From a3310be0e33a115d878238a7747a8f2a01cd048a Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 7 Jan 2023 21:27:23 +0800 Subject: [PATCH] AppDelegate // Mark the uninstall action button with red color. --- Source/Modules/AppDelegate.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Modules/AppDelegate.swift b/Source/Modules/AppDelegate.swift index f2b073c9..376158fd 100644 --- a/Source/Modules/AppDelegate.swift +++ b/Source/Modules/AppDelegate.swift @@ -105,6 +105,11 @@ extension AppDelegate { alert.messageText = NSLocalizedString("Uninstallation", comment: "") alert.informativeText = content alert.addButton(withTitle: NSLocalizedString("OK", comment: "")) + if #available(macOS 11, *) { + alert.buttons.forEach { button in + button.hasDestructiveAction = true + } + } alert.addButton(withTitle: NSLocalizedString("Not Now", comment: "")) let result = alert.runModal() NSApp.activate(ignoringOtherApps: true)