mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-03-25 01:01:11 +08:00
Add 'Copy as path' option to More menu
This commit is contained in:
@@ -236,6 +236,8 @@
|
||||
<InfoPanel_Files>{0} files</InfoPanel_Files>
|
||||
<InfoPanel_FolderAndFile>({0} and {1})</InfoPanel_FolderAndFile>
|
||||
<InfoPanel_CantPreventClosing>Cancellation of "Prevent Closing" is not supported</InfoPanel_CantPreventClosing>
|
||||
<InfoPanelMoreItem_CopyAsPath>Copy as path</InfoPanelMoreItem_CopyAsPath>
|
||||
<InfoPanelMoreItem_CopySucc>Copy successfully</InfoPanelMoreItem_CopySucc>
|
||||
</en>
|
||||
<es>
|
||||
<UI_FontFamily>Segoe UI</UI_FontFamily>
|
||||
|
||||
@@ -132,9 +132,17 @@
|
||||
ToolTip="More">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu FontSize="12">
|
||||
<MenuItem Command="{Binding OpenSettingsFileFolderCommand}" Header="SettingsFile">
|
||||
<MenuItem x:Name="moreItemCopyAsPath">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon FontFamily="{DynamicResource SymbolThemeFontFamily}" Glyph="{x:Static ui:FontSymbols.OpenLocal}" />
|
||||
<ui:FontIcon FontFamily="{DynamicResource SymbolThemeFontFamily}" Glyph="{x:Static ui:FontSymbols.Copy}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator Visibility="Collapsed" />
|
||||
<MenuItem x:Name="moreItemOpenSettings"
|
||||
Header="Settings"
|
||||
Visibility="Collapsed">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon FontFamily="{DynamicResource SymbolThemeFontFamily}" Glyph="{x:Static ui:FontSymbols.Settings}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
|
||||
@@ -20,6 +20,7 @@ using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin;
|
||||
using QuickLook.Helpers;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
@@ -110,6 +111,24 @@ public partial class ViewerWindow : Window
|
||||
|
||||
buttonReload.Visibility = SettingHelper.Get("ShowReload", false) ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
moreItemCopyAsPath.Click += (_, _) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetText(_path);
|
||||
Toast.Success(TranslationHelper.Get("InfoPanelMoreItem_CopySucc"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.WriteLine(e);
|
||||
}
|
||||
};
|
||||
|
||||
moreItemOpenSettings.Click += (_, _) =>
|
||||
{
|
||||
Toast.Warning("Coming soon...");
|
||||
};
|
||||
|
||||
// Set UI translations
|
||||
buttonTop.ToolTip = TranslationHelper.Get("MW_StayTop");
|
||||
buttonPin.ToolTip = TranslationHelper.Get("MW_PreventClosing");
|
||||
@@ -117,6 +136,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");
|
||||
moreItemCopyAsPath.Header = TranslationHelper.Get("InfoPanelMoreItem_CopyAsPath");
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
|
||||
Reference in New Issue
Block a user