fix: request redraw in menus

This commit is contained in:
Hojjat 2026-08-04 13:58:23 -06:00 • committed by Ashley Wulber
parent 1ac21a9d99
commit 5fd1ca4220
4 changed files with 14 additions and 3 deletions

View file

@ -499,8 +499,10 @@ where
let new_hovered_option = (cursor_position.y / option_height) as usize;
let mut hovered_guard = self.hovered_option.lock().unwrap();
if let Some(on_option_hovered) = self.on_option_hovered {
if *hovered_guard != Some(new_hovered_option) {
if *hovered_guard != Some(new_hovered_option) {
shell.request_redraw();
if let Some(on_option_hovered) = self.on_option_hovered {
shell.publish(on_option_hovered(new_hovered_option));
}
}

View file

@ -382,6 +382,8 @@ where
if previous_hover_option.as_ref() == Some(item) {
previous_hover_option
} else {
shell.request_redraw();
if let Some(on_option_hovered) = self.on_option_hovered {
shell.publish(on_option_hovered(item.clone()));
}