fix: request redraw in menus
This commit is contained in:
parent
1ac21a9d99
commit
5fd1ca4220
4 changed files with 14 additions and 3 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue