summaryrefslogtreecommitdiffstats
path: root/examples/svg_style/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-12-06 04:35:08 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-12-06 04:36:00 +0100
commit1220ce55bc882cc4fef891c8b2d0fdc22e18a015 (patch)
tree5b77a7be692dedd7e6203249a0b64278982f09e5 /examples/svg_style/src
parentc0ca1807d42b0ec58887df9926ff53a587104723 (diff)
downloadiced-1220ce55bc882cc4fef891c8b2d0fdc22e18a015.tar.gz
iced-1220ce55bc882cc4fef891c8b2d0fdc22e18a015.tar.bz2
iced-1220ce55bc882cc4fef891c8b2d0fdc22e18a015.zip
Showcase color filtering in existing `svg` example
... and remove the `svg_style` example
Diffstat (limited to 'examples/svg_style/src')
-rw-r--r--examples/svg_style/src/main.rs78
1 files changed, 0 insertions, 78 deletions
diff --git a/examples/svg_style/src/main.rs b/examples/svg_style/src/main.rs
deleted file mode 100644
index 0a1fa039..00000000
--- a/examples/svg_style/src/main.rs
+++ /dev/null
@@ -1,78 +0,0 @@
-use iced::widget::{container, svg};
-use iced::{Color, Element, Length, Sandbox, Settings};
-use iced_style::svg::Appearance;
-use iced_style::theme::{self, Theme};
-
-pub fn main() -> iced::Result {
- SvgStyleExample::run(Settings::default())
-}
-
-struct SvgStyleExample;
-
-impl Sandbox for SvgStyleExample {
- type Message = ();
-
- fn new() -> Self {
- SvgStyleExample
- }
-
- fn theme(&self) -> Theme {
- Theme::Light
- }
-
- fn title(&self) -> String {
- String::from("SVG - Iced")
- }
-
- fn update(&mut self, _message: ()) {}
-
- fn view(&self) -> Element<()> {
- let svg1: Element<_> = svg(svg::Handle::from_path(format!(
- "{}/resources/go-next-symbolic.svg",
- env!("CARGO_MANIFEST_DIR")
- )))
- .width(Length::Fill)
- .height(Length::Fill)
- .into();
-
- let svg2: Element<_> = svg(svg::Handle::from_path(format!(
- "{}/resources/go-next-symbolic.svg",
- env!("CARGO_MANIFEST_DIR")
- )))
- .style(theme::Svg::custom_fn(|_theme| Appearance {
- color: Some(Color {
- r: 0.0,
- g: 0.28627452,
- b: 0.42745098,
- a: 1.0,
- }),
- }))
- .width(Length::Fill)
- .height(Length::Fill)
- .into();
-
- let svg3: Element<_> = svg(svg::Handle::from_path(format!(
- "{}/resources/go-next-symbolic.svg",
- env!("CARGO_MANIFEST_DIR")
- )))
- .style(theme::Svg::custom_fn(|_theme| Appearance {
- color: Some(Color {
- r: 0.5803922,
- g: 0.92156863,
- b: 0.92156863,
- a: 1.0,
- }),
- }))
- .width(Length::Fill)
- .height(Length::Fill)
- .into();
-
- container(iced::widget::row!(svg1, svg2, svg3))
- .width(Length::Fill)
- .height(Length::Fill)
- .padding(20)
- .center_x()
- .center_y()
- .into()
- }
-}