summaryrefslogtreecommitdiffstats
path: root/examples/svg/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/svg/src/main.rs')
-rw-r--r--examples/svg/src/main.rs26
1 files changed, 14 insertions, 12 deletions
diff --git a/examples/svg/src/main.rs b/examples/svg/src/main.rs
index e071c3af..02cb85cc 100644
--- a/examples/svg/src/main.rs
+++ b/examples/svg/src/main.rs
@@ -1,5 +1,5 @@
use iced::widget::{center, checkbox, column, container, svg};
-use iced::{color, Element, Length};
+use iced::{color, Element, Fill};
pub fn main() -> iced::Result {
iced::run("SVG - Iced", Tiger::update, Tiger::view)
@@ -30,24 +30,26 @@ impl Tiger {
env!("CARGO_MANIFEST_DIR")
));
- let svg = svg(handle).width(Length::Fill).height(Length::Fill).style(
- |_theme, _status| svg::Style {
- color: if self.apply_color_filter {
- Some(color!(0x0000ff))
- } else {
- None
- },
- },
- );
+ let svg =
+ svg(handle)
+ .width(Fill)
+ .height(Fill)
+ .style(|_theme, _status| svg::Style {
+ color: if self.apply_color_filter {
+ Some(color!(0x0000ff))
+ } else {
+ None
+ },
+ });
let apply_color_filter =
checkbox("Apply a color filter", self.apply_color_filter)
.on_toggle(Message::ToggleColorFilter);
center(
- column![svg, container(apply_color_filter).center_x(Length::Fill)]
+ column![svg, container(apply_color_filter).center_x(Fill)]
.spacing(20)
- .height(Length::Fill),
+ .height(Fill),
)
.padding(20)
.into()