fix: focus rings with multiple buttons in showMessageBox
(#36772)
fix: focus rings with multiple buttons in messageBox
This commit is contained in:
parent
42cda4a893
commit
32288ac9c5
1 changed files with 5 additions and 3 deletions
|
@ -71,9 +71,6 @@ NSAlert* CreateNSAlert(const MessageBoxSettings& settings) {
|
|||
int button_count = static_cast<int>([ns_buttons count]);
|
||||
|
||||
if (settings.default_id >= 0 && settings.default_id < button_count) {
|
||||
// Highlight the button at default_id
|
||||
[[ns_buttons objectAtIndex:settings.default_id] highlight:YES];
|
||||
|
||||
// The first button added gets set as the default selected, so remove
|
||||
// that and set the button @ default_id to be default.
|
||||
[[ns_buttons objectAtIndex:0] setKeyEquivalent:@""];
|
||||
|
@ -86,6 +83,11 @@ NSAlert* CreateNSAlert(const MessageBoxSettings& settings) {
|
|||
[[ns_buttons objectAtIndex:settings.cancel_id] setKeyEquivalent:@"\e"];
|
||||
}
|
||||
|
||||
// TODO(@codebytere): This behavior violates HIG & should be deprecated.
|
||||
if (settings.cancel_id >= 0 && settings.cancel_id == settings.default_id) {
|
||||
[[ns_buttons objectAtIndex:settings.default_id] highlight:YES];
|
||||
}
|
||||
|
||||
if (!settings.checkbox_label.empty()) {
|
||||
alert.showsSuppressionButton = YES;
|
||||
alert.suppressionButton.title =
|
||||
|
|
Loading…
Reference in a new issue