Mail · Sorting: a label picker and a snooze menu
LabelPicker puts labels on a message: a field finds them by name, arrows move and a press or Enter turns one on or off, each row with its check and its hue. A name no label has can be made into one, and the field starts over. Its rows are the option rows every list shares; forms::marked_row leads one with a mark. The cursor shows only while the field has focus. SnoozePicker offers later today, tomorrow, this weekend and next week, each with its day and hour, or a time picked in a dialog. It shares mail::times with ScheduleSend: the names, the dialog, which now waits for a time ahead of now, and a rule that a moment comes once, so on a Sunday tomorrow morning no longer repeats as Monday morning.
This commit is contained in:
1 parent
14b5faa80c
commit
ccbc0970e5
16 files changed
+1037
-144
No files matched your search
+2
-2
@@ -85,8 +85,8 @@ pub use multi::MultiSelect;
|
||||
pub use number::{NumberInput, ScrubInput};
|
||||
pub use options::Choice;
|
||||
pub(crate) use options::{
|
||||
OnFlag, OnNumber, OnValue, OnValues, Pick, Run, float, float_height, reveal, revealer, step,
|
||||
surface,
|
||||
OnFlag, OnNumber, OnValue, OnValues, Pick, Run, float, float_height, marked_row, reveal,
|
||||
revealer, step, surface,
|
||||
};
|
||||
pub use pairs::{FieldArray, KeyValueInput, ListInput};
|
||||
pub use path::PathInput;
|
||||
|
||||
@@ -87,6 +87,18 @@ pub(crate) fn option_row(
|
||||
highlighted: bool,
|
||||
checked: Option<bool>,
|
||||
cx: &App,
|
||||
) -> Stateful<Div> {
|
||||
marked_row(id, choice, None, highlighted, checked, cx)
|
||||
}
|
||||
|
||||
/// An option row with `mark`, such as a label's color, before the label.
|
||||
pub(crate) fn marked_row(
|
||||
id: impl Into<ElementId>,
|
||||
choice: &Choice,
|
||||
mark: Option<AnyElement>,
|
||||
highlighted: bool,
|
||||
checked: Option<bool>,
|
||||
cx: &App,
|
||||
) -> Stateful<Div> {
|
||||
let theme = cx.theme();
|
||||
let colors = &theme.colors;
|
||||
@@ -128,6 +140,7 @@ pub(crate) fn option_row(
|
||||
.when_some(choice.icon, |row, icon| {
|
||||
row.child(Icon::new(icon).size(IconSize::Sm).color(colors.fg_muted))
|
||||
})
|
||||
.children(mark)
|
||||
.child(
|
||||
div()
|
||||
.flex_1()
|
||||
|
||||
Reference in new issue
Block a user