History

Add button link to extension repository (#7880)

Fixes: https://github.com/zed-industries/zed/issues/7873 <img width="1165" alt="image" src="https://github.com/zed-industries/zed/assets/19867440/2338519c-bd48-4716-9f88-ed155b0dad67"> Release Notes: - Added a button to link to an extension's repository

Joseph T. Lyons committed 2 years ago

Commit 577b2441 parent 2e0d18e1 file · +15 −1Browse files

Unified · Split

crates/extensions_ui/src/extensions_ui.rs+15−1
@@ -194,6 +194,8 @@ impl ExtensionsPage { · 193 unmodified lines
194194 }
195195 .color(Color::Accent);
196196
197+ let repository_url = extension.repository.clone();
198+
197199 div().w_full().child(
198200 v_flex()
199201 .w_full()
@@ -256,7 +258,19 @@ impl ExtensionsPage { · 56 unmodified lines
256258 Label::new(description.clone())
257259 .size(LabelSize::Small)
258260 .color(Color::Default)
259− })),
261+ }))
262+ .child(
263+ IconButton::new(
264+ SharedString::from(format!("repository-{}", extension.id)),
265+ IconName::Github,
266+ )
267+ .icon_color(Color::Accent)
268+ .icon_size(IconSize::Small)
269+ .style(ButtonStyle::Filled)
270+ .on_click(cx.listener(move |_, _, cx| {
271+ cx.open_url(&repository_url);
272+ })),
273+ ),
260274 ),
261275 )
262276 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t