mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-02 21:02:34 +00:00
TEST: button
This commit is contained in:
parent
2c6a995b03
commit
cea0189dfd
@ -27,6 +27,7 @@ use render::{
|
||||
homescreen, homescreen_blurred, HomescreenNotification, HomescreenText,
|
||||
HOMESCREEN_IMAGE_HEIGHT, HOMESCREEN_IMAGE_WIDTH,
|
||||
};
|
||||
use crate::ui::event::{ButtonEvent, PhysicalButton};
|
||||
|
||||
use super::{theme, Loader, LoaderMsg};
|
||||
|
||||
@ -181,10 +182,17 @@ where
|
||||
fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> {
|
||||
Self::event_usb(self, ctx, event);
|
||||
if self.hold_to_lock {
|
||||
Self::event_hold(self, ctx, event).then_some(HomescreenMsg::Dismissed)
|
||||
if Self::event_hold(self, ctx, event) {
|
||||
return Some(HomescreenMsg::Dismissed)
|
||||
}
|
||||
}
|
||||
|
||||
if let Event::Button(ButtonEvent::ButtonPressed(PhysicalButton::Power)) = event {
|
||||
Some(HomescreenMsg::Dismissed)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn paint(&mut self) {
|
||||
|
Loading…
Reference in New Issue
Block a user