1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 17:38:39 +00:00

core: fix text overflow in some dialogs

This commit is contained in:
Tomas Susanka 2020-02-27 10:26:59 +00:00
parent 744c32991f
commit a8af9feebe
3 changed files with 18 additions and 18 deletions

View File

@ -134,9 +134,9 @@ async def _require_confirm_payload(ctx, payload: bytearray, encrypt=False):
if encrypt:
text = Text("Confirm payload", ui.ICON_SEND, ui.GREEN)
text.bold("Encrypted:")
text.normal(*payload.split(" "))
text.normal(payload)
else:
text = Text("Confirm payload", ui.ICON_SEND, ui.RED)
text.bold("Unencrypted:")
text.normal(*payload.split(" "))
text.normal(payload)
await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)

View File

@ -32,7 +32,7 @@ def render_text(
) -> None:
# initial rendering state
INITIAL_OFFSET_X = offset_x
offset_y_max = offset_y * max_lines
offset_y_max = TEXT_HEADER_HEIGHT + (TEXT_LINE_HEIGHT * max_lines)
FONTS = (ui.NORMAL, ui.BOLD, ui.MONO, ui.MONO_BOLD)
@ -47,7 +47,7 @@ def render_text(
if isinstance(word, int):
if word is BR or word is BR_HALF:
# line break or half-line break
if offset_y >= offset_y_max:
if offset_y > offset_y_max:
ui.display.text(offset_x, offset_y, "...", ui.BOLD, ui.GREY, bg)
return
offset_x = INITIAL_OFFSET_X

View File

@ -18,7 +18,7 @@
"test_msg_binance_get_address.py::test_binance_get_address[m-44'-714'-0'-0-0-bnb1hgm0p7khfk85zpz5v0j8": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_binance_get_address.py::test_binance_get_address[m-44'-714'-0'-0-1-bnb1egswqkszzfc2uq78zjsl": "c53ae271ae6158320c85dfc5ef43693def6f9606a3e733db0abb78dca392b7bb",
"test_msg_binance_get_public_key.py::test_binance_get_public_key": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_binance_sign_tx.py::test_binance_sign_message[message0-expected_response0]": "07e93c712f63190a9bdb01f30c10750afd264fd2f491d9f7b89c431b9550edc8",
"test_msg_binance_sign_tx.py::test_binance_sign_message[message0-expected_response0]": "d41ee5e01a50f0f96fd7881db1750fab31cfe62c25b4eabbc092cc3daa039c7f",
"test_msg_binance_sign_tx.py::test_binance_sign_message[message1-expected_response1]": "7b8bbe5ba7d7b07c95065608fb1cf9aeafcb3f9671835a6e5e5a6997ff4ff99b",
"test_msg_binance_sign_tx.py::test_binance_sign_message[message2-expected_response2]": "813ad1b802dee1ace4dfa378edd840dbcea57c1a1b8eed67134def024c40a6e9",
"test_msg_cardano_get_address.py::test_cardano_get_address[m-44'-1815'-0'-0-0-Ae2tdPwUPEZLCq3sFv4wVYx": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
@ -75,7 +75,7 @@
"test_msg_eos_signtx.py-test_eos_signtx_vote_proxy": "4a831fc808e4b32fe9c8a5bed11cbbeb8b623391e9c603e61fbf352152f63fd9",
"test_msg_ethereum_getaddress.py-test_ethereum_getaddress": "c2e87f78afb53c0f861ebf02bb45af22ab0d336b10ea72d5ad246d1f59162211",
"test_msg_ethereum_getpublickey.py-test_ethereum_getpublickey": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_ethereum_signmessage.py-test_sign": "da471bd9779da7a17c4c4fb67ca9acedfe2a36510e3e9abc30c96cca4de24c0c",
"test_msg_ethereum_signmessage.py-test_sign": "c630df2f7260fd705d6522401024626968eec074eed08702626937c007d050ab",
"test_msg_ethereum_signtx.py-test_ethereum_sanity_checks": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_ethereum_signtx.py-test_ethereum_signtx_data": "9454b0c1ee99d865668e6ff04c32d9e14002d0f2b29d0f45e81996f711cb8068",
"test_msg_ethereum_signtx.py-test_ethereum_signtx_known_erc20_token": "2a4a3a192cb992b482d4ccb1e23e957fa1c8d04c7144a4d4329701a9f4290d2e",
@ -101,7 +101,7 @@
"test_msg_ethereum_signtx_eip155.py::test_ethereum_signtx_eip155[vector7]": "bc91fd1543c2e2e5cd52eb8e7eceeb7bbc9958c6a4d44c3c1638942e4c7cb308",
"test_msg_ethereum_signtx_eip155.py::test_ethereum_signtx_eip155[vector8]": "bc91fd1543c2e2e5cd52eb8e7eceeb7bbc9958c6a4d44c3c1638942e4c7cb308",
"test_msg_ethereum_signtx_eip155.py::test_ethereum_signtx_eip155[vector9]": "bc91fd1543c2e2e5cd52eb8e7eceeb7bbc9958c6a4d44c3c1638942e4c7cb308",
"test_msg_ethereum_verifymessage.py-test_verify": "6e22a4241a76e2ddf0027d93f0fc3b2133758b46c81e91cebd24947674e8aeba",
"test_msg_ethereum_verifymessage.py-test_verify": "5d1c3f207e498c1b6e874156f2dcb6dd51f8efc27fc5f8474c35abc7c32e4cfb",
"test_msg_ethereum_verifymessage.py-test_verify_invalid": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_getaddress.py-test_bch": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_getaddress.py-test_bch_multisig": "806770e0656c11dc8099eeba0156a359a3733184cd23a8c0e457f550e5ae1262",
@ -155,16 +155,16 @@
"test_msg_lisk_getaddress.py-test_lisk_getaddress": "0063ceb48d21aecd1ddabdb083c8afd2042cdf577e4751fa3f57b2b80f619084",
"test_msg_lisk_getpublickey.py-test_lisk_get_public_key": "e4cb8c7430c240e27a2211391ab5eba848be4f50136cf9f693142c2677a939d7",
"test_msg_lisk_signmessage.py-test_sign": "c47a6ec147137c75903cff19da6607eaef5a1fc03ace1f840d2952744342b568",
"test_msg_lisk_signmessage.py-test_sign_long": "410f482dfeb3b90f52d715ca109d0ee5cd3100deae5e71701e2203777613eb0e",
"test_msg_lisk_signmessage.py-test_sign_long": "d9824857ac7d7a530631e0847eb1d71a44a8d78ea186460a03ca74ddfcf094eb",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_cast_votes": "1211b642511c054119d79933894f942a1d714f9cef642cf7a3f60d675f93eab7",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_delegate_registration": "4e68f914978c6c130c5f7e98bc63d46e98899b4194483f13db1fac22b2a5fadb",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_multisignature": "2d2d5747973e15bf478f3c1b879fbb7f30281b3d3a7ad9ff2b3b262de80fa33e",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_second_signature": "f7312ad6214786884a5649c029a589faeaf3efa72e62dd870da4c1e28c0e5143",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_send": "69b10cf641834235146af56114260c96618d223b4d38f3e262f8d976685aa396",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_send_with_data": "d27a40c13d8266cb3ea5e4db01d0802f5ec6138124cbe8daaf9cd65b30fcdd5f",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_send_wrong_path": "61631e80e1a04ac74fe87c90c742a2a433613637c941d200870a9e8f8fffa0a2",
"test_msg_lisk_signtx.py-test_lisk_sign_tx_send_wrong_path": "08ad66a3dc5e67d9bfd592efbeea170927188f5e6d79e1faf4a9d26a96661d6a",
"test_msg_lisk_verifymessage.py-test_verify": "1854e1c346d1db91c8e35b8081e3fcfe851340a367d1207c51dac156dddc93ea",
"test_msg_lisk_verifymessage.py-test_verify_long": "32da2aa586d14093de6b414fbb58227b3e1665fefdb0184ea3aa5d036ac415b1",
"test_msg_lisk_verifymessage.py-test_verify_long": "1798e15f373dc321e43094b13d07d6bbb8ad532c31f425351433f6571d61c289",
"test_msg_loaddevice.py-test_load_device_1": "114d7e07b00f8a9fc60e0888ce3e39f79805c577b99f4d25967fcf7cf6367664",
"test_msg_loaddevice.py-test_load_device_2": "9947760ad56ea110b6f3937883c37701c866dd57b6c342806bd8e8b3aa889887",
"test_msg_loaddevice.py-test_load_device_slip39_advanced": "1c6db0d592b1d22b3c9fce3ddab8a9fd138f11d83e5d4e64431a02bf4ffed605",
@ -182,7 +182,7 @@
"test_msg_nem_signtx_multisig.py-test_nem_signtx_multisig_signer": "64eeea8ee5f838bad0cd15f7e446952c614969b0c13d7f8b18f95f74147c5991",
"test_msg_nem_signtx_others.py-test_nem_signtx_importance_transfer": "eaa237fd2c2e99da0b719f9dcd1c32863c22f3d82761e4f46559961cdc109980",
"test_msg_nem_signtx_others.py-test_nem_signtx_provision_namespace": "399e3b9cdd889ffd25a59505d2da8822b3e7775f2a9f6031cdd79c4720dbe393",
"test_msg_nem_signtx_transfers.py-test_nem_signtx_encrypted_payload": "ccbe72f47bd85de463cf537c08fe1f9314e25a0e1cb4b915ddb0084fc8de40b9",
"test_msg_nem_signtx_transfers.py-test_nem_signtx_encrypted_payload": "a1b05b9796d6509f7ee8b2fe088ac85cabf15f40535fe46b74c6c0b35851bbe6",
"test_msg_nem_signtx_transfers.py-test_nem_signtx_known_mosaic": "141da3168cd042aef5bd2fb62b52ecbca3a2ec27302f10a3a0fc98bae6d9c7da",
"test_msg_nem_signtx_transfers.py-test_nem_signtx_known_mosaic_with_levy": "0c05c1946ff84e634d391b8cb4adc9fe92c65810eb9a2b3dfb6f4f71a84c08b9",
"test_msg_nem_signtx_transfers.py-test_nem_signtx_multiple_mosaics": "e3fb11c280a9ff5121d6158f156758cc551dd7708b1c6fb3ce92ab3cffe2c184",
@ -240,21 +240,21 @@
"test_msg_signmessage.py-test_sign": "c37aec5647a983219a57a74797247505dd08e98408964207b1b34df904d6797c",
"test_msg_signmessage.py-test_sign_bch": "c37aec5647a983219a57a74797247505dd08e98408964207b1b34df904d6797c",
"test_msg_signmessage.py-test_sign_grs": "9a21b2633749b87174fb666144641f4563d58aaec5c5694e1d1eac3ac993831d",
"test_msg_signmessage.py-test_sign_long": "3593ee0fdda71eebc4ed345a14e69b211f786723c30c9f153bccdcd621b40c25",
"test_msg_signmessage.py-test_sign_long": "7576249e9bcba7937a489cf1f0c7e063026c0fcd008a98b105a96b68bb989083",
"test_msg_signmessage.py-test_sign_testnet": "c37aec5647a983219a57a74797247505dd08e98408964207b1b34df904d6797c",
"test_msg_signmessage.py-test_sign_utf": "48e01e6c84af9960581e95a60669f97eebfb8ebe43daac8f958062d77394c569",
"test_msg_signmessage_decred.py-test_sign_long": "760dd838580022cdbdb5b4b84506448cfeed2f316b68fb6669b382ad5271870e",
"test_msg_signmessage_decred.py-test_sign_long": "50da7b603a754324bc9cb364e3216656a7cc3906ca807595723b03653231b1bd",
"test_msg_signmessage_decred.py-test_sign_mainnet": "afced22a35654f96108611b53bde65e8a11cc8ab258a95012da722c818c0a2d2",
"test_msg_signmessage_decred.py-test_sign_testnet": "afced22a35654f96108611b53bde65e8a11cc8ab258a95012da722c818c0a2d2",
"test_msg_signmessage_decred.py-test_sign_utf": "068dc608b061f688875c8e0ce611d1e3e9ae269a0c9e3440374fdb1125413df8",
"test_msg_signmessage_segwit.py-test_sign": "c37aec5647a983219a57a74797247505dd08e98408964207b1b34df904d6797c",
"test_msg_signmessage_segwit.py-test_sign_grs": "9a21b2633749b87174fb666144641f4563d58aaec5c5694e1d1eac3ac993831d",
"test_msg_signmessage_segwit.py-test_sign_long": "3593ee0fdda71eebc4ed345a14e69b211f786723c30c9f153bccdcd621b40c25",
"test_msg_signmessage_segwit.py-test_sign_long": "7576249e9bcba7937a489cf1f0c7e063026c0fcd008a98b105a96b68bb989083",
"test_msg_signmessage_segwit.py-test_sign_testnet": "c37aec5647a983219a57a74797247505dd08e98408964207b1b34df904d6797c",
"test_msg_signmessage_segwit.py-test_sign_utf": "48e01e6c84af9960581e95a60669f97eebfb8ebe43daac8f958062d77394c569",
"test_msg_signmessage_segwit_native.py-test_sign": "c37aec5647a983219a57a74797247505dd08e98408964207b1b34df904d6797c",
"test_msg_signmessage_segwit_native.py-test_sign_grs": "9a21b2633749b87174fb666144641f4563d58aaec5c5694e1d1eac3ac993831d",
"test_msg_signmessage_segwit_native.py-test_sign_long": "3593ee0fdda71eebc4ed345a14e69b211f786723c30c9f153bccdcd621b40c25",
"test_msg_signmessage_segwit_native.py-test_sign_long": "7576249e9bcba7937a489cf1f0c7e063026c0fcd008a98b105a96b68bb989083",
"test_msg_signmessage_segwit_native.py-test_sign_testnet": "c37aec5647a983219a57a74797247505dd08e98408964207b1b34df904d6797c",
"test_msg_signmessage_segwit_native.py-test_sign_utf": "48e01e6c84af9960581e95a60669f97eebfb8ebe43daac8f958062d77394c569",
"test_msg_signtx.py-test_attack_change_input_address": "7660d99de0b4580f0e2af3e0c19a0a198e385fdc26de46882152c947d939b7be",
@ -347,17 +347,17 @@
"test_msg_tezos_sign_tx.py-test_tezos_smart_contract_transfer": "ef560be97a67e1cf071a7917636400892fc8206253313c224d1c4a7fffc5b411",
"test_msg_tezos_sign_tx.py-test_tezos_smart_contract_transfer_to_contract": "d0be5617db780e6c65c32b46d3e198a1f2db1f60886a1b3d3d502f4d1d0b7ba9",
"test_msg_verifymessage.py-test_message_grs": "507bd5412292355b4b0c1cb684eb2305ab4c0016f2ca297b8c1359120fbe2ae1",
"test_msg_verifymessage.py-test_message_long": "0a213804b26546a08b43a421e6867c92c03faefa41e5b5f7b5d56266ff7c7511",
"test_msg_verifymessage.py-test_message_long": "45e8597d27f354d8f7f18b96f563729b247f9454c3a9496ea0e5f985232e3ef7",
"test_msg_verifymessage.py-test_message_testnet": "7295f8f7ca84c069a0e000766fd685b1b2bafe3f2a60f8b102796d0af79ed67b",
"test_msg_verifymessage.py-test_message_verify": "a357a0874e3ae40c0e385aa5ef365a1d20a34d51feb7ea1691c0d86c6f9bf242",
"test_msg_verifymessage.py-test_message_verify_bcash": "e88b6bd86172f87662ed401b9847f7ec4a31ee67e87df584f449da89d0b7e646",
"test_msg_verifymessage.py-test_verify_bitcoind": "ad8b1680392d4348db9201653a2c0fce2b67aa54e07139d5127ba18bed21e23b",
"test_msg_verifymessage.py-test_verify_utf": "6a9fe6de0ceed6aba76a8c24b8ace541713af71e652521d42bd444c95c8dbd66",
"test_msg_verifymessage_segwit.py-test_message_long": "3a07c136e206884eab4e33224df5ae00a20f382255045fd26f7da9eca33022c2",
"test_msg_verifymessage_segwit.py-test_message_long": "84c3d161e694b656ea0472dbc77dd0d88d9772f4ffffa94c4304e3e3cb958770",
"test_msg_verifymessage_segwit.py-test_message_testnet": "2df34d0457f537023d513de468b4ccc7fbfcd70e9f980e4e1ec30d3c63157f36",
"test_msg_verifymessage_segwit.py-test_message_verify": "9af19581b27db5dfed6250f0a245be98428ac98149b3bbd93409756becee07e5",
"test_msg_verifymessage_segwit.py-test_verify_utf": "91d3f97f98780d7edd7526bf91bae0a56cf8003a31ab1baf424cec66be9e5735",
"test_msg_verifymessage_segwit_native.py-test_message_long": "22f6d25712f77b7ffe30bca6a7c649a754bd4b04af1c924f720b6c4ccea8d7a3",
"test_msg_verifymessage_segwit_native.py-test_message_long": "09bdef88a5a43df4ff349101adc05e7b485bb437b029031406348e1a3f6d6866",
"test_msg_verifymessage_segwit_native.py-test_message_testnet": "113ad2d6389810b542e5ae5aba5d0de2aa52661e321c3f1d9f45cc91637b3c1d",
"test_msg_verifymessage_segwit_native.py-test_message_verify": "b206b7a79c40525efa765718376d5f369caf424e11e93dd0eab97861dc1f4f8d",
"test_msg_verifymessage_segwit_native.py-test_verify_utf": "a8011d120ec7d776ba0a73318357b4be59f461aa927386ab13b3beff7c95c21f",