From 5c69c10094e697747c6da2de2ad40e2692be4f37 Mon Sep 17 00:00:00 2001 From: kosay Date: Sun, 25 Jun 2023 16:47:30 +0900 Subject: [PATCH] feat(ui): Remove mouse hover highlight when key input events occur. --- src/ui/window.rs | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/ui/window.rs b/src/ui/window.rs index d4d0e08b..4dca3e38 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -350,6 +350,14 @@ impl<'a> Window<'a> { pub fn clear_mouse_over(&mut self) { self.mouse_over_tab_index = None; + + self.active_tab_mut().clear_mouse_over(); + + if let Some(id) = &self.open_popup_id { + if let Some(Widget::MultipleSelect(w)) = self.popups.iter_mut().find(|w| w.id() == id) { + w.clear_mouse_over(); + } + } } } @@ -421,27 +429,10 @@ impl Window<'_> { UserEvent::Mouse(ev) => self.on_mouse_event(ev), UserEvent::FocusLost => { self.clear_mouse_over(); - self.active_tab_mut().clear_mouse_over(); - - if let Some(id) = &self.open_popup_id { - if let Some(Widget::MultipleSelect(w)) = - self.popups.iter_mut().find(|w| w.id() == id) - { - w.clear_mouse_over(); - } - } EventResult::Nop } UserEvent::FocusGained => { self.clear_mouse_over(); - self.active_tab_mut().clear_mouse_over(); - if let Some(id) = &self.open_popup_id { - if let Some(Widget::MultipleSelect(w)) = - self.popups.iter_mut().find(|w| w.id() == id) - { - w.clear_mouse_over(); - } - } EventResult::Nop }