Skip to content

Commit

Permalink
fix(core): correctly repaint ShowMore component when requested
Browse files Browse the repository at this point in the history
  • Loading branch information
matejcik committed Apr 7, 2024
1 parent fd914bd commit 6e311c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 3 additions & 2 deletions core/embed/rust/src/ui/model_tr/component/show_more.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
strutil::TString,
ui::{
component::{Child, Component, Event, EventCtx},
component::{Child, Component, Event, EventCtx, Never},
geometry::{Insets, Rect},
},
};
Expand Down Expand Up @@ -42,7 +42,7 @@ where

impl<T> Component for ShowMore<T>
where
T: Component,
T: Component<Msg = Never>,
{
type Msg = CancelInfoConfirmMsg;

Expand All @@ -55,6 +55,7 @@ where
}

fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> {
self.content.event(ctx, event);
let button_event = self.buttons.event(ctx, event);

if let Some(ButtonControllerMsg::Triggered(pos, _)) = button_event {
Expand Down
10 changes: 3 additions & 7 deletions core/embed/rust/src/ui/model_tr/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ use crate::{
trezorhal::model,
ui::{
component::{
base::Component,
connect::Connect,
paginated::{PageMsg, Paginate},
text::{
base::Component, connect::Connect, paginated::{PageMsg, Paginate}, text::{
op::OpTextLayout,
paragraphs::{
Checklist, Paragraph, ParagraphSource, ParagraphVecLong, ParagraphVecShort,
Paragraphs, VecExt,
},
TextStyle,
},
ComponentExt, FormattedText, Label, LineBreaking, Timeout,
}, ComponentExt, FormattedText, Label, LineBreaking, Never, Timeout
},
display, geometry,
layout::{
Expand Down Expand Up @@ -66,7 +62,7 @@ impl From<CancelConfirmMsg> for Obj {

impl<T> ComponentMsgObj for ShowMore<T>
where
T: Component,
T: Component<Msg = Never>,
{
fn msg_try_into_obj(&self, msg: Self::Msg) -> Result<Obj, Error> {
match msg {
Expand Down

0 comments on commit 6e311c3

Please sign in to comment.