Split window::Event::Focused into two variants
This commit is contained in:
parent
0b140488b4
commit
45dc02e9bd
2 changed files with 12 additions and 7 deletions
|
|
@ -109,6 +109,11 @@ pub fn window_event(
|
|||
WindowEvent::ModifiersChanged(new_modifiers) => Some(Event::Keyboard(
|
||||
keyboard::Event::ModifiersChanged(self::modifiers(*new_modifiers)),
|
||||
)),
|
||||
WindowEvent::Focused(focused) => Some(Event::Window(if *focused {
|
||||
window::Event::Focused
|
||||
} else {
|
||||
window::Event::Unfocused
|
||||
})),
|
||||
WindowEvent::HoveredFile(path) => {
|
||||
Some(Event::Window(window::Event::FileHovered(path.clone())))
|
||||
}
|
||||
|
|
@ -121,9 +126,6 @@ pub fn window_event(
|
|||
WindowEvent::Touch(touch) => {
|
||||
Some(Event::Touch(touch_event(*touch, scale_factor)))
|
||||
}
|
||||
WindowEvent::Focused(focused) => {
|
||||
Some(Event::Window(window::Event::Focused(*focused)))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue