diff options
| author | Titus <154823939+tituscmd@users.noreply.github.com> | 2025-11-13 21:40:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-13 21:40:51 +0100 |
| commit | 7128fc045db083c7014166872b50b536942c06e0 (patch) | |
| tree | 0dfca89ae680c9a1a024358fb82bf7e3356e939c /src/displayapp/screens/FirmwareValidation.cpp | |
| parent | 99ae2f368bd3f9ca5521d2d04a426addbb00b04b (diff) | |
Firmware validation: UI redesign (#2338)
* redesign UI for firmware validation settings page
* remove period for the sake of uniformity
* remove unnecessary symbol I added for testing purposes
* remove unnecessary whitespace
* formatting
* temporarily comment out circle radius until we deicde
* change label from Reset to Rollback
* remove commented out lines
Diffstat (limited to 'src/displayapp/screens/FirmwareValidation.cpp')
| -rw-r--r-- | src/displayapp/screens/FirmwareValidation.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/displayapp/screens/FirmwareValidation.cpp b/src/displayapp/screens/FirmwareValidation.cpp index 2a9919d5..8fc9d251 100644 --- a/src/displayapp/screens/FirmwareValidation.cpp +++ b/src/displayapp/screens/FirmwareValidation.cpp @@ -4,6 +4,7 @@ #include "components/firmwarevalidator/FirmwareValidator.h" #include "displayapp/DisplayApp.h" #include "displayapp/InfiniTimeTheme.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; @@ -15,27 +16,40 @@ namespace { } FirmwareValidation::FirmwareValidation(Pinetime::Controllers::FirmwareValidator& validator) : validator {validator} { + lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(title, "Firmware"); + lv_label_set_align(title, LV_LABEL_ALIGN_CENTER); + lv_obj_align(title, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 10, 15); + + lv_obj_t* icon = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_text_color(icon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); + lv_label_set_text_static(icon, Symbols::check); + lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER); + lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0); + labelVersion = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_recolor(labelVersion, true); lv_label_set_text_fmt(labelVersion, - "Version: %lu.%lu.%lu\n" - "ShortRef: %s", + "#808080 Version# %lu.%lu.%lu\n" + "#808080 Short Ref# %s\n", Version::Major(), Version::Minor(), Version::Patch(), Version::GitCommitHash()); - lv_obj_align(labelVersion, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); + lv_obj_align(labelVersion, nullptr, LV_ALIGN_CENTER, 0, -40); + lv_label_set_align(labelVersion, LV_LABEL_ALIGN_CENTER); labelIsValidated = lv_label_create(lv_scr_act(), nullptr); - lv_obj_align(labelIsValidated, labelVersion, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0); + lv_obj_align(labelIsValidated, nullptr, LV_ALIGN_CENTER, 0, 10); + lv_label_set_align(labelIsValidated, LV_LABEL_ALIGN_CENTER); + lv_obj_set_auto_realign(labelIsValidated, true); lv_label_set_recolor(labelIsValidated, true); - lv_label_set_long_mode(labelIsValidated, LV_LABEL_LONG_BREAK); - lv_obj_set_width(labelIsValidated, 240); if (validator.IsValidated()) { - lv_label_set_text_static(labelIsValidated, "You have already\n#00ff00 validated# this firmware#"); + lv_label_set_text_static(labelIsValidated, "This firmware has\nbeen #00ff00 validated#"); + lv_obj_align(labelIsValidated, nullptr, LV_ALIGN_CENTER, 0, 10); } else { - lv_label_set_text_static(labelIsValidated, - "Please #00ff00 Validate# this version or\n#ff0000 Reset# to rollback to the previous version."); + lv_label_set_text_static(labelIsValidated, "Any reboot will\nrollback to last\nvalidated firmware"); buttonValidate = lv_btn_create(lv_scr_act(), nullptr); buttonValidate->user_data = this; @@ -55,7 +69,7 @@ FirmwareValidation::FirmwareValidation(Pinetime::Controllers::FirmwareValidator& lv_obj_set_event_cb(buttonReset, ButtonEventHandler); labelButtonReset = lv_label_create(buttonReset, nullptr); - lv_label_set_text_static(labelButtonReset, "Reset"); + lv_label_set_text_static(labelButtonReset, "Rollback"); } } |
