Add wheel events to event example; make interface prettier
This commit is contained in:
1 parent
a46ff93600
commit
f30387597a
2 files changed
+21
-2
No files matched your search
@@ -828,7 +828,7 @@ pub mod on {
|
||||
|
||||
pub type WheelEvent = UiEvent<WheelData>;
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct WheelData {
|
||||
#[deprecated(since = "0.3.0", note = "use delta() instead")]
|
||||
pub delta_mode: u32,
|
||||
@@ -889,6 +889,14 @@ pub mod on {
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for WheelData {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("WheelData")
|
||||
.field("delta", &self.delta())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
pub type MediaEvent = UiEvent<MediaData>;
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
Reference in new issue
Block a user