mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01:00
Double click to close editor (#11098)
Co-authored-by: Niels Laute <niels9001@hotmail.com>
This commit is contained in:
@@ -198,6 +198,7 @@
|
||||
SelectionMode="Single"
|
||||
IsSelectionEnabled="True"
|
||||
ItemClick="Layout_ItemClick"
|
||||
MouseDoubleClick="LayoutItem_MouseDoubleClick"
|
||||
Margin="-8,8,-8,0">
|
||||
<ui:GridView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource LayoutItemContainerStyle}"
|
||||
@@ -250,6 +251,7 @@
|
||||
SelectionMode="Single"
|
||||
IsItemClickEnabled="True"
|
||||
ItemClick="Layout_ItemClick"
|
||||
MouseDoubleClick="LayoutItem_MouseDoubleClick"
|
||||
AutomationProperties.LabeledBy="{Binding ElementName=CustomHeaderBlock}"
|
||||
Margin="-8,8,-8,0"
|
||||
Grid.Row="4">
|
||||
|
||||
@@ -60,14 +60,24 @@ namespace FancyZonesEditor
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
if (_openedDialog != null)
|
||||
{
|
||||
_openedDialog.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnClosing(sender, null);
|
||||
}
|
||||
CloseDialog(sender);
|
||||
}
|
||||
}
|
||||
|
||||
private void LayoutItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
CloseDialog(sender);
|
||||
}
|
||||
|
||||
private void CloseDialog(object sender)
|
||||
{
|
||||
if (_openedDialog != null)
|
||||
{
|
||||
_openedDialog.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnClosing(sender, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user