mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Refactor key press handling in MessageBoxEx to improve result assignment logic
This commit is contained in:
parent
c33e9dedb8
commit
ebb74da8b3
1 changed files with 13 additions and 6 deletions
|
|
@ -159,12 +159,19 @@ namespace Flow.Launcher
|
||||||
|
|
||||||
private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
|
private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (_button == MessageBoxButton.YesNo)
|
switch (_button)
|
||||||
return;
|
{
|
||||||
else if (_button == MessageBoxButton.OK)
|
case MessageBoxButton.OK:
|
||||||
_result = MessageBoxResult.OK;
|
_result = MessageBoxResult.None;
|
||||||
else
|
break;
|
||||||
_result = MessageBoxResult.Cancel;
|
case MessageBoxButton.OKCancel:
|
||||||
|
case MessageBoxButton.YesNoCancel:
|
||||||
|
_result = MessageBoxResult.Cancel;
|
||||||
|
break;
|
||||||
|
case MessageBoxButton.YesNo:
|
||||||
|
_result = MessageBoxResult.No;
|
||||||
|
break;
|
||||||
|
}
|
||||||
DialogResult = false;
|
DialogResult = false;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue