mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make MouseButtons Forward & Back navigate (#32283)
This commit is contained in:
parent
1cd30c4c7a
commit
6c3cf81230
1 changed files with 19 additions and 0 deletions
|
@ -23,6 +23,7 @@ use servo::rendering_context::RenderingContext;
|
|||
use servo::servo_geometry::DeviceIndependentPixel;
|
||||
use servo::servo_url::ServoUrl;
|
||||
use servo::style_traits::DevicePixel;
|
||||
use winit::event::{ElementState, MouseButton};
|
||||
|
||||
use crate::egui_glue::EguiGlow;
|
||||
use crate::events_loop::EventsLoop;
|
||||
|
@ -107,6 +108,24 @@ impl Minibrowser {
|
|||
self.last_mouse_position
|
||||
.map_or(false, |p| self.is_in_browser_rect(p))
|
||||
},
|
||||
winit::event::WindowEvent::MouseInput {
|
||||
state: ElementState::Pressed,
|
||||
button: MouseButton::Forward,
|
||||
..
|
||||
} => {
|
||||
self.event_queue
|
||||
.borrow_mut()
|
||||
.push(MinibrowserEvent::Forward);
|
||||
true
|
||||
},
|
||||
winit::event::WindowEvent::MouseInput {
|
||||
state: ElementState::Pressed,
|
||||
button: MouseButton::Back,
|
||||
..
|
||||
} => {
|
||||
self.event_queue.borrow_mut().push(MinibrowserEvent::Back);
|
||||
true
|
||||
},
|
||||
winit::event::WindowEvent::MouseWheel { .. } |
|
||||
winit::event::WindowEvent::MouseInput { .. } => self
|
||||
.last_mouse_position
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue