Remove winit example

... we can extend an existing example instead!
This commit is contained in:
Héctor Ramón Jiménez 2021-07-21 18:11:31 +07:00
parent 552b7a1307
commit 4de2714213
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 0 additions and 74 deletions

View file

@ -67,7 +67,6 @@ members = [
"examples/counter",
"examples/custom_widget",
"examples/download_progress",
"examples/winit",
"examples/events",
"examples/game_of_life",
"examples/geometry",

View file

@ -1,9 +0,0 @@
[package]
name = "winit"
version = "0.1.0"
authors = ["Tim Untersberger <timuntersberger2@gmail.com>"]
edition = "2018"
publish = false
[dependencies]
iced = { path = "../.." }

View file

@ -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.
<div align="center">
<a href="https://gfycat.com/fairdeadcatbird">
<img src="https://thumbs.gfycat.com/FairDeadCatbird-small.gif">
</a>
</div>
You can run it with `cargo run`:
```
cargo run --package counter
```
[`main`]: src/main.rs

View file

@ -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<Self::Message> {
Column::new().into()
}
}