Introduce event::Status in iced_native

This commit is contained in:
Héctor Ramón Jiménez 2020-11-11 23:54:59 +01:00
parent 73811c394a
commit 1db11ba69a
2 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,4 @@
//! Handle events of a user interface.
use crate::{keyboard, mouse, window};
/// A user interface event.
@ -6,7 +7,7 @@ use crate::{keyboard, mouse, window};
/// additional events, feel free to [open an issue] and share your use case!_
///
/// [open an issue]: https://github.com/hecrj/iced/issues
#[derive(PartialEq, Clone, Debug)]
#[derive(Debug, Clone, PartialEq)]
pub enum Event {
/// A keyboard event
Keyboard(keyboard::Event),
@ -17,3 +18,23 @@ pub enum Event {
/// A window event
Window(window::Event),
}
/// The status of an [`Event`] after being processed by a [`UserInterface`].
///
/// [`Event`]: enum.Event.html
/// [`UserInterface`]: ../struct.UserInterface.html
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Status {
/// The [`Event`] was _NOT_ handled by any widget in the [`UserInterface`].
///
/// [`Event`]: enum.Event.html
/// [`UserInterface`]: ../struct.UserInterface.html
Ignored,
/// The [`Event`] was handled and processed by a widget in the
/// [`UserInterface`].
///
/// [`Event`]: enum.Event.html
/// [`UserInterface`]: ../struct.UserInterface.html
Captured,
}

View File

@ -35,6 +35,7 @@
#![deny(unused_results)]
#![forbid(unsafe_code)]
#![forbid(rust_2018_idioms)]
pub mod event;
pub mod keyboard;
pub mod layout;
pub mod mouse;
@ -47,7 +48,6 @@ pub mod window;
mod clipboard;
mod element;
mod event;
mod hasher;
mod runtime;
mod user_interface;