From d0fc77fe9bb15669ffcb9e4b25d34a7d45bbd32a Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 17 Jan 2021 02:31:37 +0100 Subject: [PATCH] [egui_glium] minor code cleanup --- egui_glium/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/egui_glium/src/lib.rs b/egui_glium/src/lib.rs index 79600a74..c7ff6087 100644 --- a/egui_glium/src/lib.rs +++ b/egui_glium/src/lib.rs @@ -49,13 +49,13 @@ pub fn input_to_egui( input_state: &mut GliumInputState, control_flow: &mut ControlFlow, ) { - use glutin::event::WindowEvent::*; + use glutin::event::WindowEvent; match event { - CloseRequested | Destroyed => *control_flow = ControlFlow::Exit, - MouseInput { state, .. } => { + WindowEvent::CloseRequested | WindowEvent::Destroyed => *control_flow = ControlFlow::Exit, + WindowEvent::MouseInput { state, .. } => { input_state.raw.mouse_down = state == glutin::event::ElementState::Pressed; } - CursorMoved { + WindowEvent::CursorMoved { position: pos_in_pixels, .. } => { @@ -64,10 +64,10 @@ pub fn input_to_egui( pos_in_pixels.y as f32 / input_state.raw.pixels_per_point.unwrap(), )); } - CursorLeft { .. } => { + WindowEvent::CursorLeft { .. } => { input_state.raw.mouse_pos = None; } - ReceivedCharacter(ch) => { + WindowEvent::ReceivedCharacter(ch) => { if printable_char(ch) && !input_state.raw.modifiers.ctrl && !input_state.raw.modifiers.mac_cmd @@ -75,7 +75,7 @@ pub fn input_to_egui( input_state.raw.events.push(Event::Text(ch.to_string())); } } - KeyboardInput { input, .. } => { + WindowEvent::KeyboardInput { input, .. } => { if let Some(keycode) = input.virtual_keycode { let pressed = input.state == glutin::event::ElementState::Pressed; @@ -135,7 +135,7 @@ pub fn input_to_egui( } } } - MouseWheel { delta, .. } => { + WindowEvent::MouseWheel { delta, .. } => { match delta { glutin::event::MouseScrollDelta::LineDelta(x, y) => { let line_height = 24.0; // TODO