diff options
author | 2024-03-04 20:42:37 +0100 | |
---|---|---|
committer | 2024-03-04 20:42:37 +0100 | |
commit | f4a4845ddbdced81ae4ff60bfa19f0e602d84709 (patch) | |
tree | b532017384eb9e43e57bf73be372aea0d55af652 /examples/todos | |
parent | db92e1c942154bee474fee5e2c187f8a52a1bb96 (diff) | |
download | iced-f4a4845ddbdced81ae4ff60bfa19f0e602d84709.tar.gz iced-f4a4845ddbdced81ae4ff60bfa19f0e602d84709.tar.bz2 iced-f4a4845ddbdced81ae4ff60bfa19f0e602d84709.zip |
Simplify theming for `Button` widget
Diffstat (limited to 'examples/todos')
-rw-r--r-- | examples/todos/src/main.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index b1aeb4a7..b3b5d87a 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -1,14 +1,14 @@ use iced::alignment::{self, Alignment}; use iced::font::{self, Font}; use iced::keyboard; -use iced::theme::{self, Theme}; use iced::widget::{ self, button, checkbox, column, container, keyed_column, row, scrollable, text, text_input, Text, }; use iced::window; -use iced::{Application, Element}; -use iced::{Command, Length, Settings, Size, Subscription}; +use iced::{ + Application, Command, Element, Length, Settings, Size, Subscription, Theme, +}; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; @@ -362,7 +362,7 @@ impl Task { button(edit_icon()) .on_press(TaskMessage::Edit) .padding(10) - .style(theme::Button::Text), + .style(button::text), ] .spacing(20) .align_items(Alignment::Center) @@ -385,7 +385,7 @@ impl Task { ) .on_press(TaskMessage::Delete) .padding(10) - .style(theme::Button::Destructive) + .style(button::destructive) ] .spacing(20) .align_items(Alignment::Center) @@ -402,9 +402,9 @@ fn view_controls(tasks: &[Task], current_filter: Filter) -> Element<Message> { let label = text(label); let button = button(label).style(if filter == current_filter { - theme::Button::Primary + button::primary } else { - theme::Button::Text + button::text }); button.on_press(Message::FilterChanged(filter)).padding(8) |