summaryrefslogtreecommitdiffstats
path: root/examples/tour/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-21 00:37:47 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-21 00:44:35 +0200
commite0e4ee73feead3f05730625c7e1917b63f0b384e (patch)
tree5cd934cc474a5aacc60359f6fe69a5b9d31fe45b /examples/tour/src
parenta1a5fcfd46622d5b18d1716aa2adb4659835ccf3 (diff)
downloadiced-e0e4ee73feead3f05730625c7e1917b63f0b384e.tar.gz
iced-e0e4ee73feead3f05730625c7e1917b63f0b384e.tar.bz2
iced-e0e4ee73feead3f05730625c7e1917b63f0b384e.zip
Implement `iced_glutin` :tada:
Diffstat (limited to 'examples/tour/src')
-rw-r--r--examples/tour/src/main.rs40
1 files changed, 16 insertions, 24 deletions
diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs
index 8c3b1d19..ca7a4f5d 100644
--- a/examples/tour/src/main.rs
+++ b/examples/tour/src/main.rs
@@ -1,20 +1,14 @@
-use iced_glow::{
- button, scrollable, slider, text_input, window, Button, Checkbox, Color,
- Column, Command, Container, Element, HorizontalAlignment, Image, Length,
- Radio, Row, Scrollable, Slider, Space, Text, TextInput,
+use iced::{
+ button, executor, scrollable, slider, text_input, Application, Button,
+ Checkbox, Color, Column, Command, Container, Element, HorizontalAlignment,
+ Image, Length, Radio, Row, Scrollable, Settings, Slider, Space, Text,
+ TextInput,
};
-use iced_winit::{executor, Application, Settings};
pub fn main() {
env_logger::init();
- Tour::run(
- Settings::default(),
- iced_glow::Settings {
- default_font: None,
- antialiasing: None,
- },
- )
+ Tour::run(Settings::default())
}
pub struct Tour {
@@ -26,7 +20,6 @@ pub struct Tour {
}
impl Application for Tour {
- type Compositor = window::Compositor;
type Executor = executor::Null;
type Message = Message;
type Flags = ();
@@ -693,18 +686,17 @@ impl<'a> Step {
fn ferris<'a>(width: u16) -> Container<'a, StepMessage> {
Container::new(
- Text::new("Not supported yet!")
// This should go away once we unify resource loading on native
// platforms
- //if cfg!(target_arch = "wasm32") {
- // Image::new("images/ferris.png")
- //} else {
- // Image::new(format!(
- // "{}/images/ferris.png",
- // env!("CARGO_MANIFEST_DIR")
- // ))
- //}
- //.width(Length::Units(width)),
+ if cfg!(target_arch = "wasm32") {
+ Image::new("images/ferris.png")
+ } else {
+ Image::new(format!(
+ "{}/images/ferris.png",
+ env!("CARGO_MANIFEST_DIR")
+ ))
+ }
+ .width(Length::Units(width)),
)
.width(Length::Fill)
.center_x()
@@ -765,7 +757,7 @@ pub enum Layout {
}
mod style {
- use iced_glow::{button, Background, Color, Vector};
+ use iced::{button, Background, Color, Vector};
pub enum Button {
Primary,