Added redraw request handling to widget events.
This commit is contained in:
parent
91fca024b6
commit
65f4ff060a
2 changed files with 8 additions and 4 deletions
|
|
@ -5,10 +5,7 @@ use crate::core::mouse::{Cursor, Interaction};
|
||||||
use crate::core::renderer::Style;
|
use crate::core::renderer::Style;
|
||||||
use crate::core::widget::tree::{State, Tag};
|
use crate::core::widget::tree::{State, Tag};
|
||||||
use crate::core::widget::{tree, Tree};
|
use crate::core::widget::{tree, Tree};
|
||||||
use crate::core::{
|
use crate::core::{self, layout, mouse, widget, Clipboard, Element, Layout, Length, Rectangle, Shell, Size, Widget, window};
|
||||||
self, layout, mouse, widget, Clipboard, Element, Layout, Length, Rectangle,
|
|
||||||
Shell, Size, Widget,
|
|
||||||
};
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
mod event;
|
mod event;
|
||||||
|
|
@ -109,6 +106,9 @@ where
|
||||||
Some(Event::Keyboard(keyboard_event))
|
Some(Event::Keyboard(keyboard_event))
|
||||||
}
|
}
|
||||||
core::Event::Touch(touch_event) => Some(Event::Touch(touch_event)),
|
core::Event::Touch(touch_event) => Some(Event::Touch(touch_event)),
|
||||||
|
core::Event::Window(window::Event::RedrawRequested(instant)) => {
|
||||||
|
Some(Event::RedrawRequested(instant))
|
||||||
|
}
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
//! Handle events of a custom shader widget.
|
//! Handle events of a custom shader widget.
|
||||||
|
use std::time::Instant;
|
||||||
use crate::core::keyboard;
|
use crate::core::keyboard;
|
||||||
use crate::core::mouse;
|
use crate::core::mouse;
|
||||||
use crate::core::touch;
|
use crate::core::touch;
|
||||||
|
|
@ -18,4 +19,7 @@ pub enum Event {
|
||||||
|
|
||||||
/// A keyboard event.
|
/// A keyboard event.
|
||||||
Keyboard(keyboard::Event),
|
Keyboard(keyboard::Event),
|
||||||
|
|
||||||
|
/// A window requested a redraw.
|
||||||
|
RedrawRequested(Instant),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue