Skip to content
代码片段 群组 项目
提交 5c96abd1 编辑于 作者: Paddy Xu's avatar Paddy Xu
浏览文件

Fix #644 step 2: add context menu to TextViewer

上级 af608dc9
No related branches found
No related tags found
无相关合并请求
......@@ -19,6 +19,7 @@ using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
......@@ -50,6 +51,12 @@ namespace QuickLook.Plugin.TextViewer
Options.EnableEmailHyperlinks = false;
Options.EnableHyperlinks = false;
ContextMenu = new ContextMenu();
ContextMenu.Items.Add(new MenuItem
{Header = TranslationHelper.Get("Editor_Copy"), Command = ApplicationCommands.Copy});
ContextMenu.Items.Add(new MenuItem
{Header = TranslationHelper.Get("Editor_SelectAll"), Command = ApplicationCommands.SelectAll});
ManipulationInertiaStarting += Viewer_ManipulationInertiaStarting;
ManipulationStarting += Viewer_ManipulationStarting;
ManipulationDelta += Viewer_ManipulationDelta;
......@@ -124,7 +131,7 @@ namespace QuickLook.Plugin.TextViewer
{
Task.Run(() =>
{
const int maxLength = 50 * 1024 * 1024;
const int maxLength = 5 * 1024 * 1024;
var buffer = new MemoryStream();
bool tooLong;
......@@ -146,7 +153,7 @@ namespace QuickLook.Plugin.TextViewer
return;
if (tooLong)
_context.Title += " (0 ~ 50MB)";
_context.Title += " (0 ~ 5MB)";
var bufferCopy = buffer.ToArray();
buffer.Dispose();
......
......@@ -9,6 +9,8 @@
</de-DE>
<en>
<Editor_FontFamily>Consolas</Editor_FontFamily>
<Editor_Copy>Copy</Editor_Copy>
<Editor_SelectAll>Select All</Editor_SelectAll>
</en>
<es-ES>
<Editor_FontFamily>Consolas</Editor_FontFamily>
......@@ -21,6 +23,8 @@
</it>
<ja-JP>
<Editor_FontFamily>Consolas,Meiryo UI,MS UI Gothic,MS Gothic</Editor_FontFamily>
<Editor_Copy>コピー</Editor_Copy>
<Editor_SelectAll>すべて選択</Editor_SelectAll>
</ja-JP>
<ko-KR>
<Editor_FontFamily>Consolas,Malgun Gothic,Batang</Editor_FontFamily>
......@@ -54,9 +58,13 @@
</vi>
<zh-CN>
<Editor_FontFamily>Consolas,Microsoft Yahei UI,Microsoft Yahei,SimSun</Editor_FontFamily>
<Editor_Copy>复制</Editor_Copy>
<Editor_SelectAll>全选</Editor_SelectAll>
</zh-CN>
<zh-TW>
<Editor_FontFamily>Consolas,Microsoft JhengHei UI,Microsoft JhengHei,MingLiU</Editor_FontFamily>
<Editor_Copy>複製</Editor_Copy>
<Editor_SelectAll>全選</Editor_SelectAll>
</zh-TW>
<mr>
<Editor_FontFamily>Consolas,Mangal,Nirmala UI</Editor_FontFamily>
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册