From 4eaadff93b0414823fe37146d160425d31458d7f Mon Sep 17 00:00:00 2001 From: "DESKTOP-3BO4HSG\\ksat" Date: Mon, 2 Jan 2023 08:50:40 +0800 Subject: [PATCH] fix: esc to unset topmost --- STranslate/MainWindow.xaml.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/STranslate/MainWindow.xaml.cs b/STranslate/MainWindow.xaml.cs index 5ffacd4..f6c361d 100644 --- a/STranslate/MainWindow.xaml.cs +++ b/STranslate/MainWindow.xaml.cs @@ -105,7 +105,11 @@ namespace STranslate this.Hide(); //取消置顶 - TopmostBtn.SetResourceReference(TemplateProperty, _UnTopmostTemplateName); + if (_IsTopmost) + { + TopmostBtn.SetResourceReference(TemplateProperty, _UnTopmostTemplateName); + _IsTopmost = !_IsTopmost; + } } //置顶 Ctrl+Shift+T if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control)