From d2bfe5629370f75fd799e4e2579f8873ada4926b Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 16 May 2024 15:28:17 +0200 Subject: [PATCH] fix(core/ui): make it harder to accidentally close VerticalMenu --- core/embed/rust/src/ui/model_mercury/component/frame.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/embed/rust/src/ui/model_mercury/component/frame.rs b/core/embed/rust/src/ui/model_mercury/component/frame.rs index b2049fab07..c1035abc3a 100644 --- a/core/embed/rust/src/ui/model_mercury/component/frame.rs +++ b/core/embed/rust/src/ui/model_mercury/component/frame.rs @@ -195,10 +195,14 @@ where fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option { self.title.event(ctx, event); self.subtitle.event(ctx, event); + let msg = self.content.event(ctx, event).map(FrameMsg::Content); + if msg.is_some() { + return msg; + } if let Some(ButtonMsg::Clicked) = self.button.event(ctx, event) { return Some(FrameMsg::Button(self.button_msg)); } - self.content.event(ctx, event).map(FrameMsg::Content) + None } fn paint(&mut self) {