mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02: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"
|
SelectionMode="Single"
|
||||||
IsSelectionEnabled="True"
|
IsSelectionEnabled="True"
|
||||||
ItemClick="Layout_ItemClick"
|
ItemClick="Layout_ItemClick"
|
||||||
|
MouseDoubleClick="LayoutItem_MouseDoubleClick"
|
||||||
Margin="-8,8,-8,0">
|
Margin="-8,8,-8,0">
|
||||||
<ui:GridView.ItemContainerStyle>
|
<ui:GridView.ItemContainerStyle>
|
||||||
<Style BasedOn="{StaticResource LayoutItemContainerStyle}"
|
<Style BasedOn="{StaticResource LayoutItemContainerStyle}"
|
||||||
@@ -250,6 +251,7 @@
|
|||||||
SelectionMode="Single"
|
SelectionMode="Single"
|
||||||
IsItemClickEnabled="True"
|
IsItemClickEnabled="True"
|
||||||
ItemClick="Layout_ItemClick"
|
ItemClick="Layout_ItemClick"
|
||||||
|
MouseDoubleClick="LayoutItem_MouseDoubleClick"
|
||||||
AutomationProperties.LabeledBy="{Binding ElementName=CustomHeaderBlock}"
|
AutomationProperties.LabeledBy="{Binding ElementName=CustomHeaderBlock}"
|
||||||
Margin="-8,8,-8,0"
|
Margin="-8,8,-8,0"
|
||||||
Grid.Row="4">
|
Grid.Row="4">
|
||||||
|
|||||||
@@ -60,14 +60,24 @@ namespace FancyZonesEditor
|
|||||||
{
|
{
|
||||||
if (e.Key == Key.Escape)
|
if (e.Key == Key.Escape)
|
||||||
{
|
{
|
||||||
if (_openedDialog != null)
|
CloseDialog(sender);
|
||||||
{
|
}
|
||||||
_openedDialog.Hide();
|
}
|
||||||
}
|
|
||||||
else
|
private void LayoutItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
OnClosing(sender, null);
|
CloseDialog(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CloseDialog(object sender)
|
||||||
|
{
|
||||||
|
if (_openedDialog != null)
|
||||||
|
{
|
||||||
|
_openedDialog.Hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnClosing(sender, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user