Add F5 shortcut key for Reload (#1922)

This commit is contained in:
Copilot
2026-04-21 19:02:53 +08:00
committed by GitHub
parent e94c4ee6fc
commit 02fe0662d7
3 changed files with 13 additions and 2 deletions
+5 -1
View File
@@ -46,7 +46,7 @@ internal class KeystrokeDispatcher : IDisposable
_validKeys =
[
Keys.Up, Keys.Down, Keys.Left, Keys.Right,
Keys.Enter, Keys.Space, Keys.Escape, Keys.F11
Keys.Enter, Keys.Space, Keys.Escape, Keys.F5, Keys.F11
];
}
@@ -136,6 +136,10 @@ internal class KeystrokeDispatcher : IDisposable
PipeServerManager.SendMessage(PipeMessages.Toggle);
break;
case Keys.F5:
PipeServerManager.SendMessage(PipeMessages.Reload);
break;
case Keys.F11:
PipeServerManager.SendMessage(PipeMessages.Fullscreen);
break;
+7
View File
@@ -37,6 +37,7 @@ public static class PipeMessages
public const string Close = "QuickLook.App.PipeMessages.Close";
public const string Quit = "QuickLook.App.PipeMessages.Quit";
public const string Fullscreen = "QuickLook.App.PipeMessages.Fullscreen";
public const string Reload = "QuickLook.App.PipeMessages.Reload";
}
public class PipeServerManager : IDisposable
@@ -168,6 +169,12 @@ public class PipeServerManager : IDisposable
DispatcherPriority.ApplicationIdle);
return false;
case PipeMessages.Reload:
Application.Current.Dispatcher.BeginInvoke(
new Action(() => ViewWindowManager.GetInstance().ReloadPreview()),
DispatcherPriority.ApplicationIdle);
return false;
case PipeMessages.Quit:
return true;
+1 -1
View File
@@ -132,7 +132,7 @@
ToolTip="More">
<Button.ContextMenu>
<ContextMenu FontSize="12">
<MenuItem x:Name="moreItemReload" Tag="PinMenu">
<MenuItem x:Name="moreItemReload" Tag="PinMenu" InputGestureText="F5">
<MenuItem.Icon>
<ui:FontIcon FontFamily="{DynamicResource SymbolThemeFontFamily}" Glyph="{x:Static ui:FontSymbols.Refresh}" />
</MenuItem.Icon>