Show amount of rooms in room list
This commit is contained in:
parent
e1585bfe30
commit
39560f1fc5
1 changed files with 4 additions and 5 deletions
|
|
@ -117,12 +117,11 @@ impl Rooms {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn render_rows(&self, rooms: Vec<String>) -> Vec<Row<String>> {
|
async fn render_rows(&self, rooms: Vec<String>) -> Vec<Row<String>> {
|
||||||
let mut rows: Vec<Row<String>> =
|
let mut rows: Vec<Row<String>> = vec![];
|
||||||
vec![Row::unsel(("Rooms", ContentStyle::default().bold()))];
|
|
||||||
|
|
||||||
if rooms.is_empty() {
|
let heading_style = ContentStyle::default().bold();
|
||||||
rows.push(Row::unsel(("none", ContentStyle::default().dark_grey())))
|
let heading = Styled::new(("Rooms", heading_style)).then(format!(" ({})", rooms.len()));
|
||||||
}
|
rows.push(Row::unsel(heading));
|
||||||
|
|
||||||
for room in rooms {
|
for room in rooms {
|
||||||
let bg_style = ContentStyle::default();
|
let bg_style = ContentStyle::default();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue