Make Widget::on_event return an event::Status
This commit is contained in:
parent
1db11ba69a
commit
3f968b8c87
20 changed files with 136 additions and 70 deletions
|
|
@ -7,9 +7,11 @@
|
|||
//! [`Canvas`]: struct.Canvas.html
|
||||
//! [`Frame`]: struct.Frame.html
|
||||
use crate::{Backend, Defaults, Primitive, Renderer};
|
||||
use iced_native::layout;
|
||||
use iced_native::mouse;
|
||||
use iced_native::{
|
||||
layout, mouse, Clipboard, Element, Hasher, Layout, Length, Point,
|
||||
Rectangle, Size, Vector, Widget,
|
||||
Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Size, Vector,
|
||||
Widget,
|
||||
};
|
||||
use std::hash::Hash;
|
||||
use std::marker::PhantomData;
|
||||
|
|
@ -166,7 +168,7 @@ where
|
|||
messages: &mut Vec<Message>,
|
||||
_renderer: &Renderer<B>,
|
||||
_clipboard: Option<&dyn Clipboard>,
|
||||
) {
|
||||
) -> event::Status {
|
||||
let bounds = layout.bounds();
|
||||
|
||||
let canvas_event = match event {
|
||||
|
|
@ -188,6 +190,8 @@ where
|
|||
messages.push(message);
|
||||
}
|
||||
}
|
||||
|
||||
event::Status::Ignored
|
||||
}
|
||||
|
||||
fn draw(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
use iced_native::keyboard;
|
||||
use iced_native::mouse;
|
||||
|
||||
pub use iced_native::event::Status;
|
||||
|
||||
/// A [`Canvas`] event.
|
||||
///
|
||||
/// [`Canvas`]: struct.Event.html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue