From 0b973fb357257b5c9358389b0acaf0c22d8eae28 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Feb 2019 00:35:16 +0100 Subject: [PATCH] Use critical alert style for wxICON_ERROR too in wxOSX After the changes of 6b8b3ee37906b5f49382741b4e1b44f48a9794c9 we could use NSCriticalAlertStyle for message boxes with wxICON_WARNING, if they also has Yes/No or Cancel button, but never for wxICON_ERROR, for which just NSWarningAlertStyle was used, which seems counterintuitive, so change the code to use NSCriticalAlertStyle for either wxICON_WARNING or wxICON_ERROR message boxes asking the user about something. Closes https://github.com/wxWidgets/wxWidgets/pull/1242 --- src/osx/cocoa/msgdlg.mm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/osx/cocoa/msgdlg.mm b/src/osx/cocoa/msgdlg.mm index ffaf9438ca..83b3b74d4f 100644 --- a/src/osx/cocoa/msgdlg.mm +++ b/src/osx/cocoa/msgdlg.mm @@ -31,7 +31,7 @@ namespace { NSAlertStyle GetAlertStyleFromWXStyle( long style ) { - if (style & wxICON_WARNING) + if (style & (wxICON_WARNING | wxICON_ERROR)) { // NSCriticalAlertStyle should only be used for questions where // caution is needed per the OS X HIG. wxICON_WARNING alone doesn't @@ -42,8 +42,6 @@ namespace else return NSWarningAlertStyle; } - else if (style & wxICON_ERROR) - return NSWarningAlertStyle; else return NSInformationalAlertStyle; }