Package examples and remove `dev-dependencies`
This commit is contained in:
parent
04086a90c9
commit
7cea737115
29
Cargo.toml
29
Cargo.toml
|
@ -29,6 +29,18 @@ members = [
|
|||
"web",
|
||||
"wgpu",
|
||||
"winit",
|
||||
"examples/bezier_tool",
|
||||
"examples/counter",
|
||||
"examples/custom_widget",
|
||||
"examples/events",
|
||||
"examples/geometry",
|
||||
"examples/pokedex",
|
||||
"examples/progress_bar",
|
||||
"examples/stopwatch",
|
||||
"examples/styling",
|
||||
"examples/svg",
|
||||
"examples/todos",
|
||||
"examples/tour",
|
||||
]
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
|
@ -37,20 +49,3 @@ iced_wgpu = { version = "0.1.0", path = "wgpu" }
|
|||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
iced_web = { version = "0.1.0", path = "web" }
|
||||
|
||||
[dev-dependencies]
|
||||
iced_native = { version = "0.1", path = "./native" }
|
||||
iced_wgpu = { version = "0.1", path = "./wgpu" }
|
||||
iced_futures = { version = "0.1.0-alpha", path = "./futures", features = ["async-std"] }
|
||||
env_logger = "0.7"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
directories = "2.0"
|
||||
futures = "0.3"
|
||||
async-std = { version = "1.3", features = ["unstable"] }
|
||||
surf = "1.0"
|
||||
rand = "0.7"
|
||||
lyon = "0.15"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
wasm-bindgen = "0.2.51"
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "bezier_tool"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced_native = { path = "../../native" }
|
||||
iced_wgpu = { path = "../../wgpu" }
|
||||
lyon = "0.15"
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "counter"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "custom_widget"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced_native = { path = "../../native" }
|
||||
iced_wgpu = { path = "../../wgpu" }
|
|
@ -0,0 +1,10 @@
|
|||
[package]
|
||||
name = "events"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced_native = { path = "../../native" }
|
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "geometry"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced_native = { path = "../../native" }
|
||||
iced_wgpu = { path = "../../wgpu" }
|
|
@ -0,0 +1,14 @@
|
|||
[package]
|
||||
name = "pokedex"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced_futures = { path = "../../futures", features = ["async-std"] }
|
||||
surf = "1.0"
|
||||
rand = "0.7"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
|
@ -1,6 +1,6 @@
|
|||
use iced::{
|
||||
button, image, Align, Application, Button, Column, Command, Container,
|
||||
Element, Image, Length, Row, Settings, Text,
|
||||
button, futures, image, Align, Application, Button, Column, Command,
|
||||
Container, Element, Image, Length, Row, Settings, Text,
|
||||
};
|
||||
|
||||
pub fn main() {
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "progress_bar"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "stopwatch"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced_native = { path = "../../native" }
|
||||
iced_futures = { path = "../../futures", features = ["async-std"] }
|
||||
async-std = { version = "1.0", features = ["unstable"] }
|
|
@ -143,6 +143,8 @@ impl Application for Stopwatch {
|
|||
}
|
||||
|
||||
mod time {
|
||||
use iced::futures;
|
||||
|
||||
pub fn every(
|
||||
duration: std::time::Duration,
|
||||
) -> iced::Subscription<std::time::Instant> {
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "styling"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
|
@ -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()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "svg"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../..", features = ["svg"] }
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
|
@ -0,0 +1,37 @@
|
|||
use iced::{Column, Container, Element, Length, Sandbox, Settings, Svg};
|
||||
|
||||
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<()> {
|
||||
let content = Column::new().padding(20).push(
|
||||
Svg::new(format!("{}/tiger.svg", env!("CARGO_MANIFEST_DIR")))
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill),
|
||||
);
|
||||
|
||||
Container::new(content)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.center_x()
|
||||
.center_y()
|
||||
.into()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
[package]
|
||||
name = "todos"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced_futures = { path = "../../futures", features = ["async-std"] }
|
||||
async-std = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
directories = "2.0"
|
|
@ -451,7 +451,7 @@ fn empty_message(message: &str) -> Element<'static, Message> {
|
|||
// Fonts
|
||||
const ICONS: Font = Font::External {
|
||||
name: "Icons",
|
||||
bytes: include_bytes!("resources/icons.ttf"),
|
||||
bytes: include_bytes!("../fonts/icons.ttf"),
|
||||
};
|
||||
|
||||
fn icon(unicode: char) -> Text {
|
|
@ -0,0 +1,13 @@
|
|||
[package]
|
||||
name = "tour"
|
||||
version = "0.1.0"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
env_logger = "0.7"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
wasm-bindgen = "0.2.51"
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
@ -681,10 +681,10 @@ fn ferris<'a>(width: u16) -> Container<'a, StepMessage> {
|
|||
// This should go away once we unify resource loading on native
|
||||
// platforms
|
||||
if cfg!(target_arch = "wasm32") {
|
||||
Image::new("resources/ferris.png")
|
||||
Image::new("images/ferris.png")
|
||||
} else {
|
||||
Image::new(format!(
|
||||
"{}/examples/resources/ferris.png",
|
||||
"{}/images/ferris.png",
|
||||
env!("CARGO_MANIFEST_DIR")
|
||||
))
|
||||
}
|
|
@ -204,6 +204,6 @@ use iced_winit as common;
|
|||
use iced_web as common;
|
||||
|
||||
pub use common::{
|
||||
Align, Background, Color, Command, Font, HorizontalAlignment, Length,
|
||||
Space, Subscription, Vector, VerticalAlignment,
|
||||
futures, Align, Background, Color, Command, Font, HorizontalAlignment,
|
||||
Length, Space, Subscription, Vector, VerticalAlignment,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue