parent
8f4b7aa5db
commit
6c025507b6
1 changed files with 31 additions and 31 deletions
|
@ -2243,37 +2243,37 @@ impl GitPanel {
|
||||||
|
|
||||||
pub(crate) fn render_co_authors(&self, cx: &Context<Self>) -> Option<AnyElement> {
|
pub(crate) fn render_co_authors(&self, cx: &Context<Self>) -> Option<AnyElement> {
|
||||||
let potential_co_authors = self.potential_co_authors(cx);
|
let potential_co_authors = self.potential_co_authors(cx);
|
||||||
// if potential_co_authors.is_empty() {
|
if potential_co_authors.is_empty() {
|
||||||
// None
|
None
|
||||||
// } else {
|
} else {
|
||||||
Some(
|
Some(
|
||||||
IconButton::new("co-authors", IconName::Person)
|
IconButton::new("co-authors", IconName::Person)
|
||||||
.shape(ui::IconButtonShape::Square)
|
.shape(ui::IconButtonShape::Square)
|
||||||
.icon_color(Color::Disabled)
|
.icon_color(Color::Disabled)
|
||||||
.selected_icon_color(Color::Selected)
|
.selected_icon_color(Color::Selected)
|
||||||
.toggle_state(self.add_coauthors)
|
.toggle_state(self.add_coauthors)
|
||||||
.tooltip(move |_, cx| {
|
.tooltip(move |_, cx| {
|
||||||
let title = format!(
|
let title = format!(
|
||||||
"Add co-authored-by:{}{}",
|
"Add co-authored-by:{}{}",
|
||||||
if potential_co_authors.len() == 1 {
|
if potential_co_authors.len() == 1 {
|
||||||
""
|
""
|
||||||
} else {
|
} else {
|
||||||
"\n"
|
"\n"
|
||||||
},
|
},
|
||||||
potential_co_authors
|
potential_co_authors
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(name, email)| format!(" {} <{}>", name, email))
|
.map(|(name, email)| format!(" {} <{}>", name, email))
|
||||||
.join("\n")
|
.join("\n")
|
||||||
);
|
);
|
||||||
Tooltip::simple(title, cx)
|
Tooltip::simple(title, cx)
|
||||||
})
|
})
|
||||||
.on_click(cx.listener(|this, _, _, cx| {
|
.on_click(cx.listener(|this, _, _, cx| {
|
||||||
this.add_coauthors = !this.add_coauthors;
|
this.add_coauthors = !this.add_coauthors;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}))
|
}))
|
||||||
.into_any_element(),
|
.into_any_element(),
|
||||||
)
|
)
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn configure_commit_button(&self, cx: &mut Context<Self>) -> (bool, &'static str) {
|
pub fn configure_commit_button(&self, cx: &mut Context<Self>) -> (bool, &'static str) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue