mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-01-12 07:04:16 +08:00
Add reload option to More context menu in ViewerWindow
Introduces a new 'Reload' menu item to the More context menu in ViewerWindow, allowing users to reload the preview directly from the menu. The menu item is wired to trigger the existing reload logic and supports localization for its header.
This commit is contained in:
@@ -132,6 +132,11 @@
|
||||
ToolTip="More">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu FontSize="12">
|
||||
<MenuItem x:Name="moreItemReload" Tag="PinMenu">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon FontFamily="{DynamicResource SymbolThemeFontFamily}" Glyph="{x:Static ui:FontSymbols.Refresh}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="moreItemCopyAsPath" Tag="PinMenu">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon FontFamily="{DynamicResource SymbolThemeFontFamily}" Glyph="{x:Static ui:FontSymbols.Copy}" />
|
||||
|
||||
@@ -113,6 +113,11 @@ public partial class ViewerWindow : Window
|
||||
|
||||
buttonReload.Visibility = SettingHelper.Get("ShowReload", false) ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
moreItemReload.Click += (_, _) =>
|
||||
{
|
||||
ViewWindowManager.GetInstance().ReloadPreview();
|
||||
};
|
||||
|
||||
moreItemCopyAsPath.Click += (_, _) =>
|
||||
{
|
||||
try
|
||||
@@ -138,6 +143,7 @@ public partial class ViewerWindow : Window
|
||||
buttonShare.ToolTip = TranslationHelper.Get("MW_Share");
|
||||
buttonReload.ToolTip = TranslationHelper.Get("MW_Reload", failsafe: "Reload");
|
||||
buttonMore.ToolTip = TranslationHelper.Get("MW_More", failsafe: "More");
|
||||
moreItemReload.Header = TranslationHelper.Get("MW_Reload");
|
||||
moreItemCopyAsPath.Header = TranslationHelper.Get("InfoPanelMoreItem_CopyAsPath");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user