mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add keyboard shortcuts to glutin browser
This commit is contained in:
parent
8892f8175d
commit
1ff4fe02d9
4 changed files with 90 additions and 15 deletions
|
@ -851,6 +851,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.on_zoom_window_event(magnification);
|
||||
}
|
||||
|
||||
WindowEvent::ResetZoom => {
|
||||
self.on_zoom_reset_window_event();
|
||||
}
|
||||
|
||||
WindowEvent::PinchZoom(magnification) => {
|
||||
self.on_pinch_zoom_window_event(magnification);
|
||||
}
|
||||
|
@ -1066,6 +1070,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.scene.set_root_layer_size(self.window_size.as_f32());
|
||||
}
|
||||
|
||||
fn on_zoom_reset_window_event(&mut self) {
|
||||
self.page_zoom = ScaleFactor::new(1.0);
|
||||
self.update_zoom_transform();
|
||||
self.send_window_size();
|
||||
}
|
||||
|
||||
fn on_zoom_window_event(&mut self, magnification: f32) {
|
||||
self.page_zoom = ScaleFactor::new((self.page_zoom.get() * magnification).max(1.0));
|
||||
self.update_zoom_transform();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue