From 7c6765b53293ad176e9e51b50f6f08a362407e7c Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 15 Jan 2021 16:39:52 +0800 Subject: [PATCH] style: add icon for copy --- src/Resources/Icons.xaml | 1 + src/Resources/Locales/en_US.xaml | 2 +- src/UI/DiffViewer.xaml.cs | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Resources/Icons.xaml b/src/Resources/Icons.xaml index 8695b9b5..b0c77714 100644 --- a/src/Resources/Icons.xaml +++ b/src/Resources/Icons.xaml @@ -9,6 +9,7 @@ M512 96C282.2 96 96 282.2 96 512s186.2 416 416 416 416-186.2 416-416S741.8 96 512 96z m-8.6 608c-23.6 0-42.8-18-42.8-41.2 0-23 19.2-41.2 42.8-41.2 23.8 0 43 18 43 41.2 0 23.2-19 41.2-43 41.2z m80.4-193.8c-34.8 20.2-46.6 35-46.6 60.6v15.8h-69.4l-0.6-17.2c-3.4-41.2 11-66.8 47.2-88 33.8-20.2 48-33 48-57.8s-24-43-53.8-43c-30.2 0-52 19.6-53.6 49.2H384c1.4-64.4 49-110 129.4-110 75 0 126.6 41.6 126.6 101.4 0 39.8-19.2 67.2-56.2 89z M888.832 0H135.168c-32.256 0-58.88 26.112-58.88 58.88v906.24c0 32.256 26.112 58.88 58.88 58.88h753.152c32.256 0 58.88-26.112 58.88-58.88v-906.24c0.512-32.768-26.112-58.88-58.368-58.88z m-164.864 176.64c30.72 0 55.808 25.088 55.808 55.808s-25.088 55.808-55.808 55.808-55.808-25.088-55.808-55.808 24.576-55.808 55.808-55.808z m-211.968 0c30.72 0 55.808 25.088 55.808 55.808S542.72 288.256 512 288.256s-55.808-25.088-55.808-55.808S481.28 176.64 512 176.64z m-211.968 0c30.72 0 55.808 25.088 55.808 55.808s-25.088 55.808-55.808 55.808-55.808-25.088-55.808-55.808 25.088-55.808 55.808-55.808z m208.896 606.208H285.184c-24.576 0-44.032-19.968-44.032-44.032 0-24.576 19.968-44.032 44.032-44.032h223.744c24.576 0 44.032 19.968 44.032 44.032 0 24.064-19.456 44.032-44.032 44.032z m229.888-211.968H285.184c-24.576 0-44.032-19.968-44.032-44.032 0-24.576 19.968-44.032 44.032-44.032h453.12c24.576 0 44.032 19.968 44.032 44.032 0.512 24.064-19.456 44.032-43.52 44.032z M490.667 85.333l42.667 0 0 853.333-42.667 0 0-853.333zM85.333 490.667l853.333 0 0 42.667-853.333 0 0-42.667z + M682.666667 42.666667H85.333333v682.666666h85.333334V128h512V42.666667zM256 213.333333l4.522667 768H896V213.333333H256z m554.666667 682.666667H341.333333V298.666667h469.333334v597.333333z M753.613 996.727L269.38 511.505 754.602 27.272z M270.387 27.273L754.62 512.495 269.398 996.728z diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml index df9588b9..6db0cd9c 100644 --- a/src/Resources/Locales/en_US.xaml +++ b/src/Resources/Locales/en_US.xaml @@ -224,7 +224,7 @@ OLD : New : LFS OBJECT CHANGE - Copy Selected Lines + Copy Confirm To Discard Changes Changes : diff --git a/src/UI/DiffViewer.xaml.cs b/src/UI/DiffViewer.xaml.cs index 0df44b5e..2e5859dc 100644 --- a/src/UI/DiffViewer.xaml.cs +++ b/src/UI/DiffViewer.xaml.cs @@ -753,8 +753,15 @@ namespace SourceGit.UI { if (grid == null) return; var menu = new ContextMenu(); + + var copyIcon = new Path(); + copyIcon.Style = FindResource("Style.Icon") as Style; + copyIcon.Data = FindResource("Icon.Copy") as Geometry; + copyIcon.Width = 10; + var copy = new MenuItem(); copy.Header = App.Text("Diff.Copy"); + copy.Icon = copyIcon; copy.Click += (o, ev) => { var items = grid.SelectedItems; if (items.Count == 0) return;