mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 10:42:08 +00:00
branch_list: Show match count on the right hand side of a header.
Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
parent
85add260f6
commit
ec47464bba
1 changed files with 6 additions and 9 deletions
|
@ -221,17 +221,14 @@ impl PickerDelegate for BranchListDelegate {
|
||||||
.with_style(style.container)
|
.with_style(style.container)
|
||||||
} else {
|
} else {
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(Label::new("Branches", style.label.clone()).aligned().left())
|
.with_child(Label::new("Branches", style.label.clone()))
|
||||||
.with_children(self.matches.is_empty().not().then(|| {
|
.with_children(self.matches.is_empty().not().then(|| {
|
||||||
let suffix = if self.matches.len() == 1 { "" } else { "es" };
|
let suffix = if self.matches.len() == 1 { "" } else { "es" };
|
||||||
Flex::row()
|
Label::new(
|
||||||
.align_children_center()
|
format!("{} match{}", self.matches.len(), suffix),
|
||||||
.with_child(Label::new(
|
style.label,
|
||||||
format!("{} match{}", self.matches.len(), suffix),
|
)
|
||||||
style.label,
|
.flex_float()
|
||||||
))
|
|
||||||
.aligned()
|
|
||||||
.right()
|
|
||||||
}))
|
}))
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(style.container)
|
.with_style(style.container)
|
||||||
|
|
Loading…
Reference in a new issue