summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-20 11:02:40 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-20 11:02:40 +0100
commit7f1c6fc14cddbf7055a4d00a4c188311592e679e (patch)
tree8c3a486c58583e204ba36597fe359f851d568fa0
parent08aa862a42b8bd710b3add7408b090d1fc918cab (diff)
downloadiced-7f1c6fc14cddbf7055a4d00a4c188311592e679e.tar.gz
iced-7f1c6fc14cddbf7055a4d00a4c188311592e679e.tar.bz2
iced-7f1c6fc14cddbf7055a4d00a4c188311592e679e.zip
Remove `scroll` example and `tour.html`
-rw-r--r--examples/scroll.rs84
-rw-r--r--examples/tour.html14
2 files changed, 0 insertions, 98 deletions
diff --git a/examples/scroll.rs b/examples/scroll.rs
deleted file mode 100644
index 61ad2a53..00000000
--- a/examples/scroll.rs
+++ /dev/null
@@ -1,84 +0,0 @@
-use iced::{
- button, scrollable, Align, Application, Button, Command, Container,
- Element, Image, Length, Scrollable, Text,
-};
-
-pub fn main() {
- env_logger::init();
-
- Example::run()
-}
-
-#[derive(Default)]
-struct Example {
- item_count: u16,
-
- scroll: scrollable::State,
- add_button: button::State,
-}
-
-#[derive(Debug, Clone, Copy)]
-pub enum Message {
- AddItem,
-}
-
-impl Application for Example {
- type Message = Message;
-
- fn new() -> (Example, Command<Message>) {
- (Example::default(), Command::none())
- }
-
- fn title(&self) -> String {
- String::from("Scroll - Iced")
- }
-
- fn update(&mut self, message: Message) -> Command<Message> {
- match message {
- Message::AddItem => {
- self.item_count += 1;
- }
- }
-
- Command::none()
- }
-
- fn view(&mut self) -> Element<Message> {
- let content = (0..self.item_count)
- .fold(
- Scrollable::new(&mut self.scroll)
- .spacing(20)
- .padding(20)
- .align_items(Align::Center),
- |scrollable, i| {
- if i % 2 == 0 {
- scrollable.push(lorem_ipsum().width(Length::Units(600)))
- } else {
- scrollable.push(
- Image::new(format!(
- "{}/examples/resources/ferris.png",
- env!("CARGO_MANIFEST_DIR")
- ))
- .width(Length::Units(400)),
- )
- }
- },
- )
- .push(
- Button::new(&mut self.add_button, Text::new("Add item"))
- .on_press(Message::AddItem)
- .padding(20)
- .border_radius(5),
- );
-
- Container::new(content)
- .width(Length::Fill)
- .height(Length::Fill)
- .center_y()
- .into()
- }
-}
-
-fn lorem_ipsum() -> Text {
- Text::new("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi in dui vel massa blandit interdum. Quisque placerat, odio ut vulputate sagittis, augue est facilisis ex, eget euismod felis magna in sapien. Nullam luctus consequat massa, ac interdum mauris blandit pellentesque. Nullam in est urna. Aliquam tristique lectus ac luctus feugiat. Aenean libero diam, euismod facilisis consequat quis, pellentesque luctus erat. Praesent vel tincidunt elit.")
-}
diff --git a/examples/tour.html b/examples/tour.html
deleted file mode 100644
index 35360e59..00000000
--- a/examples/tour.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
- <title>Tour - Iced</title>
- </head>
- <body>
- <script type="module">
- import init from "./tour/tour.js";
-
- init('./tour/tour_bg.wasm');
- </script>
- </body>
-</html>