diff options
| author | James A. Jerkins <evergreen@jamesjerkinscomputer.com> | 2021-11-01 20:12:25 (GMT) |
|---|---|---|
| committer | JF <JF002@users.noreply.github.com> | 2021-12-09 20:14:16 (GMT) |
| commit | 1e4130a9cfe6e1385d83d93e544d1e1cd79f11f8 (patch) | |
| tree | e8d8317feb38b6d39cf078839e5b9648dd7dac4f /src/displayapp/screens/PassKey.cpp | |
| parent | 62dbcbfc953a36202d96466563a8e71b8bd4ff65 (diff) | |
Fix for passkey screen scramble
When a passkey is displayed, screen on or off, and another
passkey is displayed the screen may become scrambled. Fix
the issue by insuring the whole screen is drawn every time.
Diffstat (limited to 'src/displayapp/screens/PassKey.cpp')
| -rw-r--r-- | src/displayapp/screens/PassKey.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/displayapp/screens/PassKey.cpp b/src/displayapp/screens/PassKey.cpp index 66bf0c2..9e43a54 100644 --- a/src/displayapp/screens/PassKey.cpp +++ b/src/displayapp/screens/PassKey.cpp @@ -4,11 +4,18 @@ using namespace Pinetime::Applications::Screens; PassKey::PassKey(Pinetime::Applications::DisplayApp* app, uint32_t key) : Screen(app) { - lpasskey = lv_label_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_text_color(lpasskey, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFF00)); - lv_obj_set_style_local_text_font(lpasskey, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); - lv_label_set_text_fmt(lpasskey, "%06u", key); - lv_obj_align(lpasskey, nullptr, LV_ALIGN_CENTER, 0, -20); + passkeyLabel = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_text_color(passkeyLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFF00)); + lv_obj_set_style_local_text_font(passkeyLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); + lv_label_set_text_fmt(passkeyLabel, "%06u", key); + lv_obj_align(passkeyLabel, nullptr, LV_ALIGN_CENTER, 0, -20); + + backgroundLabel = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_click(backgroundLabel, true); + lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); + lv_obj_set_size(backgroundLabel, 240, 240); + lv_obj_set_pos(backgroundLabel, 0, 0); + lv_label_set_text(backgroundLabel, ""); } PassKey::~PassKey() { |
