Use critical alert style for wxICON_ERROR too in wxOSX

After the changes of 6b8b3ee379 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
This commit is contained in:
Vadim Zeitlin
2019-02-25 00:35:16 +01:00
parent 0fc5413974
commit 0b973fb357

View File

@@ -31,7 +31,7 @@ namespace
{ {
NSAlertStyle GetAlertStyleFromWXStyle( long style ) NSAlertStyle GetAlertStyleFromWXStyle( long style )
{ {
if (style & wxICON_WARNING) if (style & (wxICON_WARNING | wxICON_ERROR))
{ {
// NSCriticalAlertStyle should only be used for questions where // NSCriticalAlertStyle should only be used for questions where
// caution is needed per the OS X HIG. wxICON_WARNING alone doesn't // caution is needed per the OS X HIG. wxICON_WARNING alone doesn't
@@ -42,8 +42,6 @@ namespace
else else
return NSWarningAlertStyle; return NSWarningAlertStyle;
} }
else if (style & wxICON_ERROR)
return NSWarningAlertStyle;
else else
return NSInformationalAlertStyle; return NSInformationalAlertStyle;
} }