mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
fix double redraw issue on menu close
This commit is contained in:
parent
6fefd6cdf5
commit
83da511dc5
1 changed files with 6 additions and 2 deletions
|
|
@ -292,6 +292,8 @@ impl<'a> Menu<'a> {
|
|||
// give up focus before issuing the command, as some commands conflict with loss of focus...
|
||||
if mi.close_on_select {
|
||||
self.gam.relinquish_focus().unwrap();
|
||||
#[cfg(not(any(target_os = "none", target_os = "xous")))]
|
||||
ticktimer_server::Ticktimer::new().unwrap().sleep_ms(100).unwrap();
|
||||
}
|
||||
if let Some(action) = mi.action_conn {
|
||||
log::debug!("doing menu action for {}", mi.name);
|
||||
|
|
@ -314,8 +316,10 @@ impl<'a> Menu<'a> {
|
|||
}
|
||||
}
|
||||
self.index = 0; // reset the index to 0
|
||||
log::trace!("menu redraw## select key");
|
||||
self.gam.redraw().unwrap();
|
||||
if !mi.close_on_select { // fix a double-redraw issue. I relinquish_focus() maps to active() which contains a redraw() already.
|
||||
log::trace!("menu redraw## select key");
|
||||
self.gam.redraw().unwrap();
|
||||
}
|
||||
break; // drop any characters that happened to trail the select key, it's probably a fat-finger error.
|
||||
},
|
||||
'←' => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue