Browse Source
Merge pull request #6991 from ltetak/osx_sound_defaultactions
[OSX] Handle default dialog actions to prevent beeping sounds
pull/7859/head
Max Katz
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
1 deletions
-
samples/ControlCatalog/Pages/DialogsPage.xaml.cs
-
src/Avalonia.Controls/Button.cs
|
|
|
@ -157,7 +157,8 @@ namespace ControlCatalog.Pages |
|
|
|
(button = new Button |
|
|
|
{ |
|
|
|
HorizontalAlignment = HorizontalAlignment.Center, |
|
|
|
Content = "Click to close" |
|
|
|
Content = "Click to close", |
|
|
|
IsDefault = true |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -539,6 +539,7 @@ namespace Avalonia.Controls |
|
|
|
if (e.Key == Key.Enter && IsVisible && IsEnabled) |
|
|
|
{ |
|
|
|
OnClick(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -552,6 +553,7 @@ namespace Avalonia.Controls |
|
|
|
if (e.Key == Key.Escape && IsVisible && IsEnabled) |
|
|
|
{ |
|
|
|
OnClick(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|