summaryrefslogtreecommitdiffstats
path: root/examples/visible_bounds/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/visible_bounds/src/main.rs')
-rw-r--r--examples/visible_bounds/src/main.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/examples/visible_bounds/src/main.rs b/examples/visible_bounds/src/main.rs
index bef5d296..d7f5a81d 100644
--- a/examples/visible_bounds/src/main.rs
+++ b/examples/visible_bounds/src/main.rs
@@ -1,14 +1,13 @@
use iced::event::{self, Event};
use iced::executor;
use iced::mouse;
-use iced::theme::{self, Theme};
use iced::widget::{
column, container, horizontal_space, row, scrollable, text, vertical_space,
};
use iced::window;
use iced::{
Alignment, Application, Color, Command, Element, Font, Length, Point,
- Rectangle, Settings, Subscription,
+ Rectangle, Settings, Subscription, Theme,
};
pub fn main() -> iced::Result {
@@ -82,7 +81,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 +104,12 @@ impl Application for Example {
})
.unwrap_or_default()
{
- Color {
+ Some(Color {
g: 1.0,
..Color::BLACK
- }
- .into()
+ })
} else {
- theme::Text::Default
+ None
},
)
};
@@ -120,7 +121,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),
@@ -131,7 +132,7 @@ impl Application for Example {
container(text("I am the outer container!"))
.id(OUTER_CONTAINER.clone())
.padding(40)
- .style(theme::Container::Box),
+ .style(container::box_),
vertical_space().height(400),
scrollable(
column![
@@ -140,7 +141,7 @@ impl Application for Example {
container(text("I am the inner container!"))
.id(INNER_CONTAINER.clone())
.padding(40)
- .style(theme::Container::Box),
+ .style(container::box_),
vertical_space().height(400),
]
.padding(20)