aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTitus <154823939+tituscmd@users.noreply.github.com>2025-05-15 21:46:25 +0200
committerGitHub <noreply@github.com>2025-05-15 20:46:25 +0100
commit85be83beab1d07d55ad4991cd8e455879e8be8cf (patch)
tree6317d34a0564657c5a04ed9a4992f98b18e2cdd7 /src
parent5b20e8e2ba8dae54c7ff5c2d26534b9746df2d15 (diff)
Add background color to progress bar when flashing firmware (#2237)
Diffstat (limited to 'src')
-rw-r--r--src/displayapp/screens/FirmwareUpdate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/displayapp/screens/FirmwareUpdate.cpp b/src/displayapp/screens/FirmwareUpdate.cpp
index c40240c9..7d00ef39 100644
--- a/src/displayapp/screens/FirmwareUpdate.cpp
+++ b/src/displayapp/screens/FirmwareUpdate.cpp
@@ -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);
}