mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
improve debug output for raise/lower; add a nonblocking relinquish
This commit is contained in:
parent
ebd636d324
commit
5e450235e3
3 changed files with 15 additions and 1 deletions
|
|
@ -354,6 +354,12 @@ impl Gam {
|
|||
0, 0, 0, 0,)
|
||||
).map(|_| ())
|
||||
}
|
||||
pub fn relinquish_focus_nb(&self) -> Result<(), xous::Error> {
|
||||
send_message(self.conn,
|
||||
Message::new_scalar(Opcode::RevertFocusNb.to_usize().unwrap(),
|
||||
0, 0, 0, 0,)
|
||||
).map(|_| ())
|
||||
}
|
||||
|
||||
pub fn glyph_height_hint(&self, glyph: GlyphStyle) -> Result<usize, xous::Error> {
|
||||
let response = send_message(self.conn,
|
||||
|
|
|
|||
|
|
@ -472,9 +472,9 @@ impl<'a> Modal<'a> {
|
|||
self.modify(None, None, false, Some(err_msg.to_str()), false, None);
|
||||
} else {
|
||||
if close {
|
||||
log::debug!("closing modal");
|
||||
// if it's a "close" button, invoke the GAM to put our box away
|
||||
self.gam.relinquish_focus().unwrap();
|
||||
xous::yield_slice();
|
||||
break; // don't process any more keys after a close message
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,4 +82,12 @@ impl<'a> TokenManager {
|
|||
None
|
||||
}
|
||||
}
|
||||
pub(crate) fn lookup_name(&self, token: &[u32; 4]) -> Option<String> {
|
||||
for entry in self.tokens.iter() {
|
||||
if entry.token == *token {
|
||||
return Some(entry.name.to_string())
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue