Add window::Event::Resized to iced_native

This commit is contained in:
Héctor Ramón Jiménez 2020-01-10 01:28:45 +01:00
parent 0a83024505
commit 7ab6ed7ef9
4 changed files with 24 additions and 1 deletions

View File

@ -1,4 +1,7 @@
use crate::input::{keyboard, mouse}; use crate::{
input::{keyboard, mouse},
window,
};
/// A user interface event. /// A user interface event.
/// ///
@ -13,4 +16,7 @@ pub enum Event {
/// A mouse event /// A mouse event
Mouse(mouse::Event), Mouse(mouse::Event),
/// A window event
Window(window::Event),
} }

View File

@ -44,6 +44,7 @@ pub mod layout;
pub mod renderer; pub mod renderer;
pub mod subscription; pub mod subscription;
pub mod widget; pub mod widget;
pub mod window;
mod clipboard; mod clipboard;
mod element; mod element;

4
native/src/window.rs Normal file
View File

@ -0,0 +1,4 @@
//! Build window-based GUI applications.
mod event;
pub use event::Event;

View File

@ -0,0 +1,12 @@
/// A window-related event.
#[derive(PartialEq, Clone, Copy, Debug)]
pub enum Event {
/// A window was resized
Resized {
/// The new width of the window (in units)
width: u32,
/// The new height of the window (in units)
height: u32,
},
}