Add background color to progress bar when flashing firmware (#2237)
This commit is contained in:
parent
5b20e8e2ba
commit
85be83beab
|
|
@ -2,6 +2,7 @@
|
|||
#include <lvgl/lvgl.h>
|
||||
#include "components/ble/BleController.h"
|
||||
#include "displayapp/DisplayApp.h"
|
||||
#include "displayapp/InfiniTimeTheme.h"
|
||||
|
||||
using namespace Pinetime::Applications::Screens;
|
||||
|
||||
|
|
@ -12,6 +13,9 @@ FirmwareUpdate::FirmwareUpdate(const Pinetime::Controllers::Ble& bleController)
|
|||
lv_obj_align(titleLabel, nullptr, LV_ALIGN_IN_TOP_MID, 0, 50);
|
||||
|
||||
bar1 = lv_bar_create(lv_scr_act(), nullptr);
|
||||
lv_obj_set_style_local_bg_color(bar1, LV_BAR_PART_BG, LV_STATE_DEFAULT, Colors::bgAlt);
|
||||
lv_obj_set_style_local_bg_opa(bar1, LV_BAR_PART_BG, LV_STATE_DEFAULT, LV_OPA_100);
|
||||
lv_obj_set_style_local_radius(bar1, LV_BAR_PART_BG, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
|
||||
lv_obj_set_size(bar1, 200, 30);
|
||||
lv_obj_align(bar1, nullptr, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_bar_set_range(bar1, 0, 1000);
|
||||
|
|
@ -75,7 +79,7 @@ void FirmwareUpdate::DisplayProgression() const {
|
|||
const uint32_t total = bleController.FirmwareUpdateTotalBytes();
|
||||
const int16_t permille = current / (total / 1000);
|
||||
|
||||
lv_label_set_text_fmt(percentLabel, "%d %%", permille / 10);
|
||||
lv_label_set_text_fmt(percentLabel, "%d%%", permille / 10);
|
||||
|
||||
lv_bar_set_value(bar1, permille, LV_ANIM_OFF);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue