feature<PageTabBar>: add context menu to copy repositories store path

This commit is contained in:
leo 2021-10-09 14:29:44 +08:00
parent bb6c99056e
commit 9e8cf02370
3 changed files with 11 additions and 1 deletions

View file

@ -290,6 +290,7 @@
<sys:String x:Key="Text.PageTabBar.Tab.CloseOther">Close Other Tabs</sys:String> <sys:String x:Key="Text.PageTabBar.Tab.CloseOther">Close Other Tabs</sys:String>
<sys:String x:Key="Text.PageTabBar.Tab.CloseRight">Close Tabs to the Right</sys:String> <sys:String x:Key="Text.PageTabBar.Tab.CloseRight">Close Tabs to the Right</sys:String>
<sys:String x:Key="Text.PageTabBar.Tab.Bookmark">Bookmark</sys:String> <sys:String x:Key="Text.PageTabBar.Tab.Bookmark">Bookmark</sys:String>
<sys:String x:Key="Text.PageTabBar.Tab.CopyPath">Copy Path</sys:String>
<sys:String x:Key="Text.Merge">Merge Branch</sys:String> <sys:String x:Key="Text.Merge">Merge Branch</sys:String>
<sys:String x:Key="Text.Merge.Source">Source Branch :</sys:String> <sys:String x:Key="Text.Merge.Source">Source Branch :</sys:String>

View file

@ -289,6 +289,7 @@
<sys:String x:Key="Text.PageTabBar.Tab.CloseOther">关闭其他标签页</sys:String> <sys:String x:Key="Text.PageTabBar.Tab.CloseOther">关闭其他标签页</sys:String>
<sys:String x:Key="Text.PageTabBar.Tab.CloseRight">关闭右侧标签页</sys:String> <sys:String x:Key="Text.PageTabBar.Tab.CloseRight">关闭右侧标签页</sys:String>
<sys:String x:Key="Text.PageTabBar.Tab.Bookmark">设置书签</sys:String> <sys:String x:Key="Text.PageTabBar.Tab.Bookmark">设置书签</sys:String>
<sys:String x:Key="Text.PageTabBar.Tab.CopyPath">复制仓库路径</sys:String>
<sys:String x:Key="Text.Merge">合并分支</sys:String> <sys:String x:Key="Text.Merge">合并分支</sys:String>
<sys:String x:Key="Text.Merge.Source">合并分支 </sys:String> <sys:String x:Key="Text.Merge.Source">合并分支 </sys:String>

View file

@ -336,7 +336,15 @@ namespace SourceGit.Views.Widgets {
} }
menu.Items.Add(new Separator()); menu.Items.Add(new Separator());
menu.Items.Add(bookmark); 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; menu.IsOpen = true;
e.Handled = true; e.Handled = true;