Re-export variants of Length and alignment types

This commit is contained in:
Héctor Ramón Jiménez 2024-07-12 18:12:34 +02:00
parent f9dd5cbb09
commit 76737351ea
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
51 changed files with 255 additions and 395 deletions

View file

@ -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()