diff options
author | 2024-03-04 19:31:26 +0100 | |
---|---|---|
committer | 2024-03-04 19:32:13 +0100 | |
commit | 4130ae4be95ce850263fbc55f490b68a95361d58 (patch) | |
tree | 25b1acc723e217e5890e20aa8e796db0f35be231 /examples/visible_bounds/src/main.rs | |
parent | ce309db37b8eb9860ae1f1be1710fb39e7a9edea (diff) | |
download | iced-4130ae4be95ce850263fbc55f490b68a95361d58.tar.gz iced-4130ae4be95ce850263fbc55f490b68a95361d58.tar.bz2 iced-4130ae4be95ce850263fbc55f490b68a95361d58.zip |
Simplify theming for `Text` widget
Diffstat (limited to 'examples/visible_bounds/src/main.rs')
-rw-r--r-- | examples/visible_bounds/src/main.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/visible_bounds/src/main.rs b/examples/visible_bounds/src/main.rs index bef5d296..10cdc783 100644 --- a/examples/visible_bounds/src/main.rs +++ b/examples/visible_bounds/src/main.rs @@ -82,7 +82,10 @@ impl Application for Example { row![ text(label), horizontal_space(), - text(value).font(Font::MONOSPACE).size(14).style(color), + text(value) + .font(Font::MONOSPACE) + .size(14) + .color_maybe(color), ] .height(40) .align_items(Alignment::Center) @@ -102,13 +105,12 @@ impl Application for Example { }) .unwrap_or_default() { - Color { + Some(Color { g: 1.0, ..Color::BLACK - } - .into() + }) } else { - theme::Text::Default + None }, ) }; @@ -120,7 +122,7 @@ impl Application for Example { Some(Point { x, y }) => format!("({x}, {y})"), None => "unknown".to_string(), }, - theme::Text::Default, + None, ), view_bounds("Outer container", self.outer_bounds), view_bounds("Inner container", self.inner_bounds), |