mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-31 14:35:18 +00:00
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
Background="White"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Initialized="InitializedEventHandler"
|
||||
Closed="OnClosed">
|
||||
Initialized="OnInitialized"
|
||||
Closing="OnClosing">
|
||||
<Window.Resources>
|
||||
<Converters:BooleanToBrushConverter x:Key="BooleanToBrushConverter" />
|
||||
<Converters:ModelToVisibilityConverter x:Key="ModelToVisibilityConverter" />
|
||||
|
@@ -29,6 +29,9 @@ namespace FancyZonesEditor
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = _settings;
|
||||
|
||||
KeyUp += MainWindow_KeyUp;
|
||||
|
||||
if (_settings.WorkArea.Height < 900)
|
||||
{
|
||||
SizeToContent = SizeToContent.WidthAndHeight;
|
||||
@@ -36,6 +39,14 @@ namespace FancyZonesEditor
|
||||
}
|
||||
}
|
||||
|
||||
private void MainWindow_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
OnClosing(sender, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void DecrementZones_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_settings.ZoneCount > 1)
|
||||
@@ -152,7 +163,7 @@ namespace FancyZonesEditor
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClosed(object sender, EventArgs e)
|
||||
private void OnClosing(object sender, EventArgs e)
|
||||
{
|
||||
if (!_editing)
|
||||
{
|
||||
@@ -160,7 +171,7 @@ namespace FancyZonesEditor
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializedEventHandler(object sender, EventArgs e)
|
||||
private void OnInitialized(object sender, EventArgs e)
|
||||
{
|
||||
SetSelectedItem();
|
||||
}
|
||||
|
Reference in New Issue
Block a user