Show contact status

This commit is contained in:
Antonio Scandurra 2022-10-07 13:56:28 +02:00
parent d7cea646fc
commit 4aaf3df8c7
6 changed files with 41 additions and 5 deletions

View file

@ -522,10 +522,31 @@ impl ContactsPopover {
MouseEventHandler::<Contact>::new(contact.user.id as usize, cx, |_, _| {
Flex::row()
.with_children(contact.user.avatar.clone().map(|avatar| {
Image::new(avatar)
.with_style(theme.contact_avatar)
.aligned()
.left()
let status_badge = if contact.online {
Some(
Empty::new()
.collapsed()
.contained()
.with_style(if contact.busy {
theme.contact_status_busy
} else {
theme.contact_status_free
})
.aligned()
.boxed(),
)
} else {
None
};
Stack::new()
.with_child(
Image::new(avatar)
.with_style(theme.contact_avatar)
.aligned()
.left()
.boxed(),
)
.with_children(status_badge)
.boxed()
}))
.with_child(