Add push_maybe to Column and Row
This commit is contained in:
parent
e57668d677
commit
feab96f323
9 changed files with 144 additions and 95 deletions
|
|
@ -111,11 +111,10 @@ impl Application for App {
|
|||
column![text(title).size(14), content].spacing(5)
|
||||
};
|
||||
|
||||
let mut add_toast = button("Add Toast");
|
||||
|
||||
if !self.editing.body.is_empty() && !self.editing.title.is_empty() {
|
||||
add_toast = add_toast.on_press(Message::Add);
|
||||
}
|
||||
let add_toast = button("Add Toast").on_press_maybe(
|
||||
(!self.editing.body.is_empty() && !self.editing.title.is_empty())
|
||||
.then_some(Message::Add),
|
||||
);
|
||||
|
||||
let content = container(
|
||||
column![
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue