mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
close settings with esc
This commit is contained in:
@@ -108,5 +108,10 @@ namespace Wox
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public new bool IsFocused
|
||||||
|
{
|
||||||
|
get { return tbHotkey.IsFocused; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
Title="{DynamicResource woxsettings}"
|
Title="{DynamicResource woxsettings}"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Height="600" Width="800">
|
Height="600" Width="800" PreviewKeyDown="Window_PreviewKeyDown">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<ListBoxItem HorizontalContentAlignment="Stretch"
|
<ListBoxItem HorizontalContentAlignment="Stretch"
|
||||||
IsEnabled="False"
|
IsEnabled="False"
|
||||||
|
|||||||
@@ -774,5 +774,14 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private void Window_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||||
|
{
|
||||||
|
// Hide window with ESC, but make sure it is not pressed as a hotkey
|
||||||
|
if (e.Key == Key.Escape && !ctlHotkey.IsFocused)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user