update
This commit is contained in:
@@ -269,6 +269,7 @@ impl Render for RepoDetailView {
|
||||
.unwrap_or_else(|| "Overview".into());
|
||||
|
||||
let relays = announcement.relays.clone();
|
||||
let web = announcement.web.clone();
|
||||
|
||||
v_flex()
|
||||
.id("repo")
|
||||
@@ -284,12 +285,13 @@ impl Render for RepoDetailView {
|
||||
.border_color(cx.theme().border)
|
||||
.child(
|
||||
v_flex()
|
||||
.flex_none()
|
||||
.flex_1()
|
||||
.min_w_0()
|
||||
.child(div().font_semibold().child(name))
|
||||
.child(
|
||||
div()
|
||||
.w_full()
|
||||
.text_sm()
|
||||
.text_xs()
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
.line_clamp(3)
|
||||
.child(description),
|
||||
@@ -297,7 +299,7 @@ impl Render for RepoDetailView {
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.flex_1()
|
||||
.flex_none()
|
||||
.gap_2()
|
||||
.justify_end()
|
||||
.child(
|
||||
@@ -329,6 +331,28 @@ impl Render for RepoDetailView {
|
||||
menu
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
DropdownButton::new("web")
|
||||
.button(Button::new("web-trigger").label("Websites").ghost())
|
||||
.dropdown_menu(move |menu, _window, _cx| {
|
||||
let mut menu = menu;
|
||||
if web.is_empty() {
|
||||
return menu
|
||||
.item(PopupMenuItem::new("No web").disabled(true));
|
||||
}
|
||||
for url in web.iter() {
|
||||
let href = url.to_string();
|
||||
menu = menu.item(
|
||||
PopupMenuItem::new(href.clone()).on_click(
|
||||
move |_, _, cx| {
|
||||
cx.open_url(&href);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
menu
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
Button::new("link")
|
||||
.icon(IconName::ExternalLink)
|
||||
|
||||
Reference in New Issue
Block a user