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::{
strutil::TString,
ui::{
component::{Child, Component, Event, EventCtx},
component::{Child, Component, Event, EventCtx, Never},
geometry::{Insets, Rect},
shape::Renderer,
},
@ -43,7 +43,7 @@ where
impl<T> Component for ShowMore<T>
where
T: Component,
T: Component<Msg = Never>,
{
type Msg = CancelInfoConfirmMsg;
@ -56,6 +56,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 {

View File

@ -32,18 +32,14 @@ use crate::{
ui::{
backlight::BACKLIGHT_LEVELS_OBJ,
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
},
geometry,
layout::{
@ -64,7 +60,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 {