summaryrefslogtreecommitdiffstats
path: root/examples/svg.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-01-21 00:15:01 +0100
committerLibravatar GitHub <noreply@github.com>2020-01-21 00:15:01 +0100
commit7016221556ea8183ebcd8ef8df00044e2eda71e7 (patch)
treebc1609b71b88437fc7497af339b6427f63121c76 /examples/svg.rs
parent6ca5e6184f9f1c12b427bdafcce0b4e9fbc5bb14 (diff)
parent91d9d65a03ce9b211e4043726e7424949d314325 (diff)
downloadiced-7016221556ea8183ebcd8ef8df00044e2eda71e7.tar.gz
iced-7016221556ea8183ebcd8ef8df00044e2eda71e7.tar.bz2
iced-7016221556ea8183ebcd8ef8df00044e2eda71e7.zip
Merge pull request #164 from hecrj/feature/custom-runtime
Custom futures executor with `iced_futures`
Diffstat (limited to 'examples/svg.rs')
-rw-r--r--examples/svg.rs54
1 files changed, 0 insertions, 54 deletions
diff --git a/examples/svg.rs b/examples/svg.rs
deleted file mode 100644
index 1895039d..00000000
--- a/examples/svg.rs
+++ /dev/null
@@ -1,54 +0,0 @@
-use iced::{Container, Element, Length, Sandbox, Settings};
-
-pub fn main() {
- Tiger::run(Settings::default())
-}
-
-#[derive(Default)]
-struct Tiger;
-
-impl Sandbox for Tiger {
- type Message = ();
-
- fn new() -> Self {
- Self::default()
- }
-
- fn title(&self) -> String {
- String::from("SVG - Iced")
- }
-
- fn update(&mut self, _message: ()) {}
-
- fn view(&mut self) -> Element<()> {
- #[cfg(feature = "svg")]
- let content = {
- use iced::{Column, Svg};
-
- Column::new().padding(20).push(
- Svg::new(format!(
- "{}/examples/resources/tiger.svg",
- env!("CARGO_MANIFEST_DIR")
- ))
- .width(Length::Fill)
- .height(Length::Fill),
- )
- };
-
- #[cfg(not(feature = "svg"))]
- let content = {
- use iced::{HorizontalAlignment, Text};
-
- Text::new("You need to enable the `svg` feature!")
- .horizontal_alignment(HorizontalAlignment::Center)
- .size(30)
- };
-
- Container::new(content)
- .width(Length::Fill)
- .height(Length::Fill)
- .center_x()
- .center_y()
- .into()
- }
-}