Introduce MouseEventHandler
Still need to give elements the ability to re-render their parent view. Once that is in place, I think we can implement hoverable close tab buttons.
This commit is contained in:
@@ -21,4 +21,7 @@ pub enum Event {
|
||||
LeftMouseDragged {
|
||||
position: Vector2F,
|
||||
},
|
||||
MouseMoved {
|
||||
position: Vector2F,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -108,6 +108,12 @@ impl Event {
|
||||
),
|
||||
precise: native_event.hasPreciseScrollingDeltas() == YES,
|
||||
}),
|
||||
NSEventType::NSMouseMoved => window_height.map(|window_height| Self::MouseMoved {
|
||||
position: vec2f(
|
||||
native_event.locationInWindow().x as f32,
|
||||
window_height - native_event.locationInWindow().y as f32,
|
||||
),
|
||||
}),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user