Skip to content

Commit

Permalink
feat(ui): Remove mouse hover highlight when key input events occur.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarub0b0 committed Jun 25, 2023
1 parent b8dda87 commit 5c69c10
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/ui/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
}

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5c69c10

Please sign in to comment.