mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix flashing bar artifact in vault UI
This commit is contained in:
parent
9821ed7d93
commit
27e5f0b72f
3 changed files with 7 additions and 4 deletions
|
|
@ -486,7 +486,7 @@ fn main() -> ! {
|
||||||
vault_ui.redraw();
|
vault_ui.redraw();
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
log::info!("unhandled key {}", k);
|
log::debug!("unhandled key {}", k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ pub(crate) fn pumper(
|
||||||
{
|
{
|
||||||
// we really want mode.lock() to be in a different scope so...
|
// we really want mode.lock() to be in a different scope so...
|
||||||
if mode_cache == VaultMode::Totp {
|
if mode_cache == VaultMode::Totp {
|
||||||
tt.sleep_ms(50).unwrap();
|
tt.sleep_ms(250).unwrap();
|
||||||
send_message(
|
send_message(
|
||||||
self_conn,
|
self_conn,
|
||||||
Message::new_scalar(PumpOp::Pump.to_usize().unwrap(), 0, 0, 0, 0),
|
Message::new_scalar(PumpOp::Pump.to_usize().unwrap(), 0, 0, 0, 0),
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ impl VaultUi {
|
||||||
.set_margin(TotpLayout::totp_margin())
|
.set_margin(TotpLayout::totp_margin())
|
||||||
.pane_size(TotpLayout::list_box())
|
.pane_size(TotpLayout::list_box())
|
||||||
.style(TotpLayout::list_font());
|
.style(TotpLayout::list_font());
|
||||||
|
totp_list.set_autoflush(false);
|
||||||
|
|
||||||
let gfx = Gfx::new(&xns).unwrap();
|
let gfx = Gfx::new(&xns).unwrap();
|
||||||
let style = DEFAULT_FONT;
|
let style = DEFAULT_FONT;
|
||||||
|
|
@ -258,9 +259,10 @@ impl VaultUi {
|
||||||
self.totp_list.draw(TotpLayout::timer_box().br().y);
|
self.totp_list.draw(TotpLayout::timer_box().br().y);
|
||||||
|
|
||||||
// draw the timer element
|
// draw the timer element
|
||||||
|
let mut object_list = ObjectList::new();
|
||||||
let mut timer_box = TotpLayout::timer_box();
|
let mut timer_box = TotpLayout::timer_box();
|
||||||
timer_box.style = DrawStyle::new(PixelColor::Dark, PixelColor::Light, 1);
|
timer_box.style = DrawStyle::new(PixelColor::Dark, PixelColor::Light, 1);
|
||||||
self.gfx.draw_rectangle(timer_box).ok();
|
object_list.push(ClipObjectType::Rect(timer_box)).unwrap();
|
||||||
|
|
||||||
// draw the duration bar
|
// draw the duration bar
|
||||||
let current_time = std::time::SystemTime::now()
|
let current_time = std::time::SystemTime::now()
|
||||||
|
|
@ -281,7 +283,8 @@ impl VaultUi {
|
||||||
let delta_width = (delta * width * 128) / (30 * 128 * 1000);
|
let delta_width = (delta * width * 128) / (30 * 128 * 1000);
|
||||||
timer_remaining.br = Point::new(width - delta_width, timer_remaining.br().y);
|
timer_remaining.br = Point::new(width - delta_width, timer_remaining.br().y);
|
||||||
timer_remaining.style = DrawStyle::new(PixelColor::Light, PixelColor::Light, 1);
|
timer_remaining.style = DrawStyle::new(PixelColor::Light, PixelColor::Light, 1);
|
||||||
self.gfx.draw_rectangle(timer_remaining).ok();
|
object_list.push(ClipObjectType::Rect(timer_remaining)).unwrap();
|
||||||
|
self.gfx.draw_object_list(object_list).unwrap();
|
||||||
}
|
}
|
||||||
VaultMode::Password => {
|
VaultMode::Password => {
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue