1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-17 20:08:12 +00:00

fix(core): correctly repaint ShowMore component when requested

This commit is contained in:
matejcik 2024-03-07 10:13:22 +01:00 committed by matejcik
parent adc9b523be
commit 577c36614e
2 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,7 @@
use crate::{ use crate::{
strutil::TString, strutil::TString,
ui::{ ui::{
component::{Child, Component, Event, EventCtx}, component::{Child, Component, Event, EventCtx, Never},
geometry::{Insets, Rect}, geometry::{Insets, Rect},
shape::Renderer, shape::Renderer,
}, },
@ -43,7 +43,7 @@ where
impl<T> Component for ShowMore<T> impl<T> Component for ShowMore<T>
where where
T: Component, T: Component<Msg = Never>,
{ {
type Msg = CancelInfoConfirmMsg; type Msg = CancelInfoConfirmMsg;
@ -56,6 +56,7 @@ where
} }
fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> { 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); let button_event = self.buttons.event(ctx, event);
if let Some(ButtonControllerMsg::Triggered(pos, _)) = button_event { if let Some(ButtonControllerMsg::Triggered(pos, _)) = button_event {

View File

@ -32,18 +32,14 @@ use crate::{
ui::{ ui::{
backlight::BACKLIGHT_LEVELS_OBJ, backlight::BACKLIGHT_LEVELS_OBJ,
component::{ component::{
base::Component, base::Component, connect::Connect, paginated::{PageMsg, Paginate}, text::{
connect::Connect,
paginated::{PageMsg, Paginate},
text::{
op::OpTextLayout, op::OpTextLayout,
paragraphs::{ paragraphs::{
Checklist, Paragraph, ParagraphSource, ParagraphVecLong, ParagraphVecShort, Checklist, Paragraph, ParagraphSource, ParagraphVecLong, ParagraphVecShort,
Paragraphs, VecExt, Paragraphs, VecExt,
}, },
TextStyle, TextStyle,
}, }, ComponentExt, FormattedText, Label, LineBreaking, Never, Timeout
ComponentExt, FormattedText, Label, LineBreaking, Timeout,
}, },
geometry, geometry,
layout::{ layout::{
@ -64,7 +60,7 @@ impl From<CancelConfirmMsg> for Obj {
impl<T> ComponentMsgObj for ShowMore<T> impl<T> ComponentMsgObj for ShowMore<T>
where where
T: Component, T: Component<Msg = Never>,
{ {
fn msg_try_into_obj(&self, msg: Self::Msg) -> Result<Obj, Error> { fn msg_try_into_obj(&self, msg: Self::Msg) -> Result<Obj, Error> {
match msg { match msg {