mirror of
https://github.com/LegitCamper/picocalc-os-rs.git
synced 2025-12-28 16:25:33 +00:00
WIP
This commit is contained in:
@@ -55,6 +55,9 @@ impl<'a> SelectionUi<'a> {
|
||||
if key.state == KeyState::Pressed {
|
||||
if let Some(s) = self.update(display, key.key)? {
|
||||
selection = Some(s);
|
||||
display
|
||||
.clear(Rgb565::BLACK)
|
||||
.map_err(|e| SelectionUiError::DisplayError(e))?;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +72,6 @@ impl<'a> SelectionUi<'a> {
|
||||
display: &mut Display,
|
||||
key: KeyCode,
|
||||
) -> Result<Option<usize>, SelectionUiError<<Display as DrawTarget>::Error>> {
|
||||
print!("Got Key: {:?}", key);
|
||||
match key {
|
||||
KeyCode::Down => {
|
||||
self.selection = (self.selection + 1).min(self.items.len() - 1);
|
||||
@@ -80,7 +82,6 @@ impl<'a> SelectionUi<'a> {
|
||||
KeyCode::Enter | KeyCode::Right => return Ok(Some(self.selection)),
|
||||
_ => return Ok(None),
|
||||
};
|
||||
print!("new selection: {:?}", self.selection);
|
||||
self.draw(display)?;
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user