From 9e8cf023701bea8b70df250c89164445d40912e6 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 9 Oct 2021 14:29:44 +0800 Subject: [PATCH] feature: add context menu to copy repositories store path --- src/Resources/Locales/en_US.xaml | 1 + src/Resources/Locales/zh_CN.xaml | 1 + src/Views/Widgets/PageTabBar.xaml.cs | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml index 82c827ac..bed1b0f2 100644 --- a/src/Resources/Locales/en_US.xaml +++ b/src/Resources/Locales/en_US.xaml @@ -290,6 +290,7 @@ Close Other Tabs Close Tabs to the Right Bookmark + Copy Path Merge Branch Source Branch : diff --git a/src/Resources/Locales/zh_CN.xaml b/src/Resources/Locales/zh_CN.xaml index 3adbf3cc..801fcf7f 100644 --- a/src/Resources/Locales/zh_CN.xaml +++ b/src/Resources/Locales/zh_CN.xaml @@ -289,6 +289,7 @@ 关闭其他标签页 关闭右侧标签页 设置书签 + 复制仓库路径 合并分支 合并分支 : diff --git a/src/Views/Widgets/PageTabBar.xaml.cs b/src/Views/Widgets/PageTabBar.xaml.cs index 3ba5e38c..f8519dc4 100644 --- a/src/Views/Widgets/PageTabBar.xaml.cs +++ b/src/Views/Widgets/PageTabBar.xaml.cs @@ -336,7 +336,15 @@ namespace SourceGit.Views.Widgets { } menu.Items.Add(new Separator()); menu.Items.Add(bookmark); - } + + var copyPath = new MenuItem(); + copyPath.Header = App.Text("PageTabBar.Tab.CopyPath"); + copyPath.Click += (_, __) => { + Clipboard.SetDataObject(tab.Id); + }; + menu.Items.Add(new Separator()); + menu.Items.Add(copyPath); + } menu.IsOpen = true; e.Handled = true;