diff options
| author | 2023-03-30 00:56:00 +0200 | |
|---|---|---|
| committer | 2023-03-30 00:56:00 +0200 | |
| commit | 707de9d788dc3c49d4ac57a19afac1bb938b78d9 (patch) | |
| tree | a1f38efa232742f375afae751d433276a83f7e49 /examples/todos/src | |
| parent | 472fbdf1875e82bc89ac0bbd4b2ff09cae1d9620 (diff) | |
| download | iced-707de9d788dc3c49d4ac57a19afac1bb938b78d9.tar.gz iced-707de9d788dc3c49d4ac57a19afac1bb938b78d9.tar.bz2 iced-707de9d788dc3c49d4ac57a19afac1bb938b78d9.zip  | |
Introduce support for `Font` attributes
Diffstat (limited to '')
| -rw-r--r-- | examples/todos/src/main.rs | 15 | 
1 files changed, 9 insertions, 6 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index 48b4f2f8..ed3684d3 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -392,10 +392,14 @@ impl Task {                  row![                      text_input, -                    button(row![delete_icon(), "Delete"].spacing(10)) -                        .on_press(TaskMessage::Delete) -                        .padding(10) -                        .style(theme::Button::Destructive) +                    button( +                        row![delete_icon(), "Delete"] +                            .spacing(10) +                            .align_items(Alignment::Center) +                    ) +                    .on_press(TaskMessage::Delete) +                    .padding(10) +                    .style(theme::Button::Destructive)                  ]                  .spacing(20)                  .align_items(Alignment::Center) @@ -487,14 +491,13 @@ fn empty_message(message: &str) -> Element<'_, Message> {  }  // Fonts -const ICONS: Font = Font::Name("Iced-Todos-Icons"); +const ICONS: Font = Font::with_name("Iced-Todos-Icons");  fn icon(unicode: char) -> Text<'static> {      text(unicode.to_string())          .font(ICONS)          .width(20)          .horizontal_alignment(alignment::Horizontal::Center) -        .size(20)  }  fn edit_icon() -> Text<'static> {  | 
