mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +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...
|
// give up focus before issuing the command, as some commands conflict with loss of focus...
|
||||||
if mi.close_on_select {
|
if mi.close_on_select {
|
||||||
self.gam.relinquish_focus().unwrap();
|
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 {
|
if let Some(action) = mi.action_conn {
|
||||||
log::debug!("doing menu action for {}", mi.name);
|
log::debug!("doing menu action for {}", mi.name);
|
||||||
|
|
@ -314,8 +316,10 @@ impl<'a> Menu<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.index = 0; // reset the index to 0
|
self.index = 0; // reset the index to 0
|
||||||
log::trace!("menu redraw## select key");
|
if !mi.close_on_select { // fix a double-redraw issue. I relinquish_focus() maps to active() which contains a redraw() already.
|
||||||
self.gam.redraw().unwrap();
|
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.
|
break; // drop any characters that happened to trail the select key, it's probably a fat-finger error.
|
||||||
},
|
},
|
||||||
'←' => {
|
'←' => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue