summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar shan <shankern@protonmail.com>2022-10-06 07:28:05 -0700
committerLibravatar shan <shankern@protonmail.com>2022-10-06 07:28:05 -0700
commitcb7c4676543cd508dfae8d4dcbd9cc8b61b1a94e (patch)
treed72191140c2a7a4919a0787431c1c6da60a55964 /examples
parent1eb8d972ba60592da7bfc27fe7ec80138e64dd7b (diff)
downloadiced-cb7c4676543cd508dfae8d4dcbd9cc8b61b1a94e.tar.gz
iced-cb7c4676543cd508dfae8d4dcbd9cc8b61b1a94e.tar.bz2
iced-cb7c4676543cd508dfae8d4dcbd9cc8b61b1a94e.zip
Fixed lint issues & cleaned up some documentation.
Diffstat (limited to 'examples')
-rw-r--r--examples/clock/src/main.rs6
-rw-r--r--examples/modern_art/Cargo.toml3
-rw-r--r--examples/modern_art/src/main.rs5
-rw-r--r--examples/solar_system/src/main.rs7
4 files changed, 9 insertions, 12 deletions
diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs
index 06ed44f0..be614201 100644
--- a/examples/clock/src/main.rs
+++ b/examples/clock/src/main.rs
@@ -1,6 +1,6 @@
use iced::executor;
use iced::widget::canvas::{
- Cache, Cursor, Geometry, LineCap, Path, Stroke, Style,
+ Cache, Cursor, Geometry, LineCap, Path, Stroke, stroke,
};
use iced::widget::{canvas, container};
use iced::{
@@ -111,7 +111,7 @@ impl<Message> canvas::Program<Message> for Clock {
let thin_stroke = || -> Stroke {
Stroke {
width,
- style: Style::Solid(Color::WHITE),
+ style: stroke::Style::Solid(Color::WHITE),
line_cap: LineCap::Round,
..Stroke::default()
}
@@ -120,7 +120,7 @@ impl<Message> canvas::Program<Message> for Clock {
let wide_stroke = || -> Stroke {
Stroke {
width: width * 3.0,
- style: Style::Solid(Color::WHITE),
+ style: stroke::Style::Solid(Color::WHITE),
line_cap: LineCap::Round,
..Stroke::default()
}
diff --git a/examples/modern_art/Cargo.toml b/examples/modern_art/Cargo.toml
index 8242f7e4..a48361ae 100644
--- a/examples/modern_art/Cargo.toml
+++ b/examples/modern_art/Cargo.toml
@@ -7,5 +7,4 @@ publish = false
[dependencies]
iced = { path = "../..", features = ["canvas", "tokio", "debug"] }
-iced_graphics = { path = "../../graphics" }
-rand = "0.8.5" \ No newline at end of file
+rand = "0.8.5"
diff --git a/examples/modern_art/src/main.rs b/examples/modern_art/src/main.rs
index a7aa2d8a..6a22b27f 100644
--- a/examples/modern_art/src/main.rs
+++ b/examples/modern_art/src/main.rs
@@ -1,13 +1,12 @@
use rand::{Rng, thread_rng};
use crate::canvas::{Cursor, Geometry};
-use iced::widget::canvas::{Cache, Fill, Frame, Gradient};
+use iced::widget::canvas::{Cache, Fill, Frame, Gradient, fill};
use iced::widget::{canvas, Canvas};
use iced::Settings;
use iced::{
executor, Application, Color, Command, Element, Length, Point, Rectangle,
Renderer, Size, Theme,
};
-use iced_graphics::widget::canvas::fill;
fn main() -> iced::Result {
ModernArt::run(Settings {
@@ -139,4 +138,4 @@ fn generate_box(frame: &mut Frame, bounds: Size) -> bool {
};
solid
-} \ No newline at end of file
+}
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index 8d713ce0..5f90245c 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -11,7 +11,7 @@ use iced::executor;
use iced::theme::{self, Theme};
use iced::time;
use iced::widget::canvas;
-use iced::widget::canvas::{Cursor, Path, Stroke};
+use iced::widget::canvas::{Cursor, Path, Stroke, stroke};
use iced::window;
use iced::{
Application, Color, Command, Element, Length, Point, Rectangle, Settings,
@@ -19,7 +19,6 @@ use iced::{
};
use std::time::Instant;
-use crate::canvas::Style;
pub fn main() -> iced::Result {
SolarSystem::run(Settings {
@@ -85,7 +84,7 @@ impl Application for SolarSystem {
}
fn subscription(&self) -> Subscription<Message> {
- time::every(std::time::Duration::from_millis(10)).map(Message::Tick)
+ time::every(time::Duration::from_millis(10)).map(Message::Tick)
}
}
@@ -179,7 +178,7 @@ impl<Message> canvas::Program<Message> for State {
frame.stroke(
&orbit,
Stroke {
- style: Style::Solid(Color::from_rgba8(0, 153, 255, 0.1)),
+ style: stroke::Style::Solid(Color::from_rgba8(0, 153, 255, 0.1)),
width: 1.0,
line_dash: canvas::LineDash {
offset: 0,