trezor-firmware
trezor-firmware copied to clipboard
Success animation for Model R
Imeplements #2293
Implements also popup screen from design, but text is not centered (limitation of Paragraph implementation in rust, seems out of scope for this PR to implement that). Button in the popup also differs, since out current button implementation does not follow design. Fonts used in design are also not available.
Builds on #2276 which should be merged first.
pushed some fixes requested in review and also: fixed a off by one bug in a8634321339c29bdf3221cc46e7ff16f4ce3a428 removed confusing comment: 33c770c2048082dec46aab8ee2d41296a5440267 removed unnecessary casting: 60127ff66a5973465d727917a942fd51c83cc590
looks good from my side. please rebase, squash as appropriate, and implement https://github.com/trezor/trezor-firmware/pull/2339#discussion_r923900217
Squashed, rebased, fixed https://github.com/trezor/trezor-firmware/pull/2339#discussion_r923900217
Also changed the animation end detection in https://github.com/trezor/trezor-firmware/commit/e32aaf6543194d0ad8458550a78b5fb8a40d516e and https://github.com/trezor/trezor-firmware/commit/413ac64563d9945ad1f02093e05f8e0f7eefe5fd since the issue has been fixed in meantime.
Open points:
- offset handling - do we want to remove it? maybe do evaluation and possible removal in another issue?
- recall @matejcik not being happy about
Loader
component name for use it the hold to confirm animation, any suggestions? - not happy about
icon_rust
name also. do we even want to keep this? (it has an advantage of being capable of drawing on odd x coordinate, but mainly i just used it as stepping stone for implementation of more complex display functions)
- offset handling - do we want to remove it? maybe do evaluation and possible removal in another issue?
Let's keep it for now and create an issue. One thing I would love to try is to scroll off the window contents via the offset functionality.
- recall @matejcik not being happy about
Loader
component name for use it the hold to confirm animation, any suggestions?
That is true. How about progress_button
or button_progress
?
But we can do that separately too, probably in the same step where we introduce a proper "loader" for TR.
- not happy about
icon_rust
name also. do we even want to keep this? (it has an advantage of being capable of drawing on odd x coordinate, but mainly i just used it as stepping stone for implementation of more complex display functions)
Let's keep it for now. I would like to do more in this direction, in particular, introduce a struct Icon
, we can modify the icon_rust
name in that step.
(maybe @grdddj already did something about a separate Icon type?)
I would like to do more in this direction, in particular, introduce a
struct Icon
, we can modify theicon_rust
name in that step. (maybe @grdddj already did something about a separate Icon type?)
Yes, I am already using Icon
struct as a convenient way to allow drawing/helper methods on the data (and also to name the icon for debugging purposes).
Current situation:
-
Icon
is defined at https://github.com/trezor/trezor-firmware/blob/grdddj/trezor_r_passphrase_input/core/embed/rust/src/ui/display.rs#L1088-L1164 - individual icons are created as
const
at https://github.com/trezor/trezor-firmware/blob/grdddj/trezor_r_passphrase_input/core/embed/rust/src/ui/model_tr/theme.rs#L19-L53
It could be also relevant here - I have made a HoldToConfirm::icon
and Loader::icon
constructors, to enable me to create the HTC
component even with icon data. And I assume we will want the possibility to use HTC
with icon, the implementation should not be too different than the text one