Re-export variants of Length and alignment types
This commit is contained in:
parent
f9dd5cbb09
commit
76737351ea
51 changed files with 255 additions and 395 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue