From 4de27142133b2dd6f780f0f955f620787102e581 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 21 Jul 2021 18:11:31 +0700 Subject: Remove `winit` example ... we can extend an existing example instead! --- Cargo.toml | 1 - examples/winit/Cargo.toml | 9 --------- examples/winit/README.md | 18 ------------------ examples/winit/src/main.rs | 46 ---------------------------------------------- 4 files changed, 74 deletions(-) delete mode 100644 examples/winit/Cargo.toml delete mode 100644 examples/winit/README.md delete mode 100644 examples/winit/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index b5ceb20f..329877c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,6 @@ members = [ "examples/counter", "examples/custom_widget", "examples/download_progress", - "examples/winit", "examples/events", "examples/game_of_life", "examples/geometry", diff --git a/examples/winit/Cargo.toml b/examples/winit/Cargo.toml deleted file mode 100644 index 2286dfc9..00000000 --- a/examples/winit/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "winit" -version = "0.1.0" -authors = ["Tim Untersberger "] -edition = "2018" -publish = false - -[dependencies] -iced = { path = "../.." } diff --git a/examples/winit/README.md b/examples/winit/README.md deleted file mode 100644 index 4d9fc5b9..00000000 --- a/examples/winit/README.md +++ /dev/null @@ -1,18 +0,0 @@ -## Counter - -The classic counter example explained in the [`README`](../../README.md). - -The __[`main`]__ file contains all the code of the example. - -
- - - -
- -You can run it with `cargo run`: -``` -cargo run --package counter -``` - -[`main`]: src/main.rs diff --git a/examples/winit/src/main.rs b/examples/winit/src/main.rs deleted file mode 100644 index a1364ea6..00000000 --- a/examples/winit/src/main.rs +++ /dev/null @@ -1,46 +0,0 @@ -use iced::{Column, Element, Sandbox, Settings, window::Settings as WindowSettings}; - -const WINDOW_WIDTH: i32 = 200; -const WINDOW_HEIGHT: i32 = 200; -const DISPLAY_WIDTH: i32 = 1920; -const DISPLAY_HEIGHT: i32 = 1080; -// These numbers are specific to a 1920x1080 monitor -const BORDER_X: i32 = 8; -const BORDER_Y: i32 = 2; -const CAPTION_HEIGHT: i32 = 4; - -pub fn main() { - let x = DISPLAY_WIDTH / 2 - WINDOW_WIDTH / 2 - BORDER_X; - let y = DISPLAY_HEIGHT / 2 - WINDOW_HEIGHT / 2 - BORDER_Y - CAPTION_HEIGHT; - let settings = Settings { - window: WindowSettings { - size: (WINDOW_WIDTH as u32, WINDOW_HEIGHT as u32), - position: (x, y), - ..Default::default() - }, - ..Default::default() - }; - Winit::run(settings).unwrap() -} - -#[derive(Default)] -struct Winit; - -impl Sandbox for Winit { - type Message = (); - - fn new() -> Self { - Self::default() - } - - fn title(&self) -> String { - String::from("winit - Iced") - } - - fn update(&mut self, _message: Self::Message) { - } - - fn view(&mut self) -> Element { - Column::new().into() - } -} -- cgit