extensions: Add copy author info button in context menu (#27221)
Closes #26108 Add "Copy Author Info" button to extension context menu. Release Notes: - Added option to copy extension author's name and email from extension context menu.
This commit is contained in:
parent
bc1c0a2297
commit
9134630841
1 changed files with 9 additions and 0 deletions
|
@ -612,6 +612,7 @@ impl ExtensionsPage {
|
||||||
self.buttons_for_entry(extension, &status, has_dev_extension, cx);
|
self.buttons_for_entry(extension, &status, has_dev_extension, cx);
|
||||||
let version = extension.manifest.version.clone();
|
let version = extension.manifest.version.clone();
|
||||||
let repository_url = extension.manifest.repository.clone();
|
let repository_url = extension.manifest.repository.clone();
|
||||||
|
let authors = extension.manifest.authors.clone();
|
||||||
|
|
||||||
let installed_version = match status {
|
let installed_version = match status {
|
||||||
ExtensionStatus::Installed(installed_version) => Some(installed_version),
|
ExtensionStatus::Installed(installed_version) => Some(installed_version),
|
||||||
|
@ -749,6 +750,7 @@ impl ExtensionsPage {
|
||||||
Some(Self::render_remote_extension_context_menu(
|
Some(Self::render_remote_extension_context_menu(
|
||||||
&this,
|
&this,
|
||||||
extension_id.clone(),
|
extension_id.clone(),
|
||||||
|
authors.clone(),
|
||||||
window,
|
window,
|
||||||
cx,
|
cx,
|
||||||
))
|
))
|
||||||
|
@ -761,6 +763,7 @@ impl ExtensionsPage {
|
||||||
fn render_remote_extension_context_menu(
|
fn render_remote_extension_context_menu(
|
||||||
this: &Entity<Self>,
|
this: &Entity<Self>,
|
||||||
extension_id: Arc<str>,
|
extension_id: Arc<str>,
|
||||||
|
authors: Vec<String>,
|
||||||
window: &mut Window,
|
window: &mut Window,
|
||||||
cx: &mut App,
|
cx: &mut App,
|
||||||
) -> Entity<ContextMenu> {
|
) -> Entity<ContextMenu> {
|
||||||
|
@ -782,6 +785,12 @@ impl ExtensionsPage {
|
||||||
cx.write_to_clipboard(ClipboardItem::new_string(extension_id.to_string()));
|
cx.write_to_clipboard(ClipboardItem::new_string(extension_id.to_string()));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.entry("Copy Author Info", None, {
|
||||||
|
let authors = authors.clone();
|
||||||
|
move |_, cx| {
|
||||||
|
cx.write_to_clipboard(ClipboardItem::new_string(authors.join(", ")));
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
context_menu
|
context_menu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue