mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[FancyZones] Focus layout type instead of activating it on enter press (#12823)
This commit is contained in:
@@ -42,6 +42,20 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
KeyUp += MainWindow_KeyUp;
|
KeyUp += MainWindow_KeyUp;
|
||||||
|
|
||||||
|
// Prevent closing the dialog with enter
|
||||||
|
PreviewKeyDown += (object sender, KeyEventArgs e) =>
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Enter && _openedDialog != null && _openedDialog.IsVisible)
|
||||||
|
{
|
||||||
|
var source = e.OriginalSource as RadioButton;
|
||||||
|
if (source != null && source.IsChecked != true)
|
||||||
|
{
|
||||||
|
source.IsChecked = true;
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (spanZonesAcrossMonitors)
|
if (spanZonesAcrossMonitors)
|
||||||
{
|
{
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
|||||||
Reference in New Issue
Block a user