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

fix(core/rust) Handle also touchStop event in brightess dialog

This commit is contained in:
Lukas Bielesch 2024-10-23 16:45:32 +02:00 committed by Lukáš Bielesch
parent 2e0e8eb39b
commit 262747baa7
2 changed files with 17 additions and 16 deletions

View File

@ -0,0 +1 @@
[T3T1] Add instruction to Swipe up after changing brightness.

View File

@ -76,24 +76,24 @@ impl Component for NumberInputSliderDialog {
}
fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> {
if let Some(value) = self.input.event(ctx, event) {
self.val = value;
let msg_opt = self.input.event(ctx, event);
if self.val == self.init_val || self.input.touching {
self.footer
.update_instruction(ctx, TR::instructions__swipe_horizontally);
self.footer.update_description(ctx, TR::setting__adjust);
ctx.request_paint();
} else {
self.footer
.update_instruction(ctx, TR::instructions__swipe_up);
self.footer.update_description(ctx, TR::setting__apply);
ctx.request_paint();
}
return Some(Self::Msg::Changed(value));
if self.val == self.init_val || self.input.touching {
self.footer
.update_instruction(ctx, TR::instructions__swipe_horizontally);
self.footer.update_description(ctx, TR::setting__adjust);
ctx.request_paint();
} else {
self.footer
.update_instruction(ctx, TR::instructions__swipe_up);
self.footer.update_description(ctx, TR::setting__apply);
ctx.request_paint();
}
None
msg_opt.map(|value| {
self.val = value;
Self::Msg::Changed(value)
})
}
fn paint(&mut self) {