From 44aabc25b3cb1eac1c6fb8240fdcfda9544116be Mon Sep 17 00:00:00 2001 From: Lukas Bielesch Date: Sun, 16 Feb 2025 11:41:15 +0100 Subject: [PATCH] feat(eckhart): Add new Button 'is_pressed' function --- core/embed/rust/src/ui/layout_eckhart/component/button.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/embed/rust/src/ui/layout_eckhart/component/button.rs b/core/embed/rust/src/ui/layout_eckhart/component/button.rs index 894cb6f63b..ae5a1145dd 100644 --- a/core/embed/rust/src/ui/layout_eckhart/component/button.rs +++ b/core/embed/rust/src/ui/layout_eckhart/component/button.rs @@ -135,6 +135,10 @@ impl Button { ) } + pub fn is_pressed(&self) -> bool { + matches!(self.state, State::Pressed) + } + pub fn long_press(&self) -> Option { self.long_press }