Add reload option to More context menu in ViewerWindow
Some checks failed
build / build (push) Has been cancelled
build / publish (push) Has been cancelled

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:
ema
2025-12-27 00:21:48 +08:00
parent dbceea59b6
commit 9e5b389ddd
2 changed files with 11 additions and 0 deletions

View File

@@ -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}" />

View File

@@ -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");
}