diff options
| author | JF <jf@codingfield.com> | 2022-01-07 16:31:01 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2022-01-07 16:31:01 (GMT) |
| commit | adc7909c9823c5cd9fc9888a84e84f9182b9088f (patch) | |
| tree | 778abfb7792fb7e58e3ec4408c9e56444f383e25 /src/displayapp/screens/PassKey.cpp | |
| parent | cfef0131b7b1bb83c81db417c43d6d499594125f (diff) | |
| parent | 26ae828e393d28390c5ea718bec9d4c1a96435ac (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/displayapp/screens/PassKey.cpp')
| -rw-r--r-- | src/displayapp/screens/PassKey.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/displayapp/screens/PassKey.cpp b/src/displayapp/screens/PassKey.cpp new file mode 100644 index 0000000..9e43a54 --- /dev/null +++ b/src/displayapp/screens/PassKey.cpp @@ -0,0 +1,24 @@ +#include "PassKey.h" +#include "displayapp/DisplayApp.h" + +using namespace Pinetime::Applications::Screens; + +PassKey::PassKey(Pinetime::Applications::DisplayApp* app, uint32_t key) : Screen(app) { + 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() { + lv_obj_clean(lv_scr_act()); +} + |
