Mail · Boxes and lists: mailboxes, folders and labels, the mail list, inbox zero
MailboxList sets mailboxes, folders and labels in sections: a press, an arrow or Enter opens one, the open one lit; a box with mail unread stands out with its count, and a label wears one of the theme's chart hues. MailList holds messages in a multiple-select list: the sender strong beside a dot while unread, the subject and first words under it, the time today, the weekday this week, the date this year or with its year, a paperclip for files, and a star whose press stays off the row. InboxZeroState points to feedback::EmptyState. Sections of selectable lists now have one home, lists::Sections, which ChannelList and MemberList use too; ListItem gains a third line.
This commit is contained in:
1 parent
7b38f99dcf
commit
7d20567921
17 files changed
+1244
-153
No files matched your search
@@ -20,6 +20,7 @@ pub struct ListItem {
|
||||
id: ElementId,
|
||||
title: SharedString,
|
||||
description: Option<SharedString>,
|
||||
detail: Option<SharedString>,
|
||||
leading: Option<AnyElement>,
|
||||
trailing: Option<AnyElement>,
|
||||
selected: bool,
|
||||
@@ -36,6 +37,7 @@ impl ListItem {
|
||||
id: id.into(),
|
||||
title: title.into(),
|
||||
description: None,
|
||||
detail: None,
|
||||
leading: None,
|
||||
trailing: None,
|
||||
selected: false,
|
||||
@@ -65,6 +67,12 @@ impl ListItem {
|
||||
self
|
||||
}
|
||||
|
||||
/// A third line, quieter still, such as a message's first words.
|
||||
pub fn detail(mut self, text: impl Into<SharedString>) -> Self {
|
||||
self.detail = Some(text.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// An icon or an avatar before the text.
|
||||
pub fn leading(mut self, element: impl IntoElement) -> Self {
|
||||
self.leading = Some(element.into_any_element());
|
||||
@@ -164,6 +172,11 @@ impl RenderOnce for ListItem {
|
||||
line(text)
|
||||
.text_size(theme.text_size(TextSize::Sm))
|
||||
.text_color(colors.fg_muted)
|
||||
}))
|
||||
.children(self.detail.map(|text| {
|
||||
line(text)
|
||||
.text_size(theme.text_size(TextSize::Sm))
|
||||
.text_color(colors.fg_subtle)
|
||||
})),
|
||||
)
|
||||
.children(self.trailing.map(|trailing| {
|
||||
|
||||
Reference in new issue
Block a user