diff options
author | 2021-07-21 18:11:31 +0700 | |
---|---|---|
committer | 2021-07-21 18:11:31 +0700 | |
commit | 4de27142133b2dd6f780f0f955f620787102e581 (patch) | |
tree | 57e150dcc97c3d5447fd8b4566ddcf41e2132258 /examples/winit/src/main.rs | |
parent | 552b7a1307ceaf83d00cbee88dc33ae5d92ee53e (diff) | |
download | iced-4de27142133b2dd6f780f0f955f620787102e581.tar.gz iced-4de27142133b2dd6f780f0f955f620787102e581.tar.bz2 iced-4de27142133b2dd6f780f0f955f620787102e581.zip |
Remove `winit` example
... we can extend an existing example instead!
Diffstat (limited to '')
-rw-r--r-- | examples/winit/src/main.rs | 46 |
1 files changed, 0 insertions, 46 deletions
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<Self::Message> { - Column::new().into() - } -} |