aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp
diff options
context:
space:
mode:
authorItai Nelken <70802936+Itai-Nelken@users.noreply.github.com>2023-02-21 20:48:42 +0200
committerGitHub <noreply@github.com>2023-02-21 20:48:42 +0200
commit56b6291ab779acd8cd5af007a0a97397a93a33f2 (patch)
treeac43bec5f6f7691d0226783c7f67d254639187b8 /src/displayapp
parentf4684f6ea52a76637dece97edb915ac74425d7d9 (diff)
WatchfaceAnalog: add ble icon (#1430)
Diffstat (limited to 'src/displayapp')
-rw-r--r--src/displayapp/screens/WatchFaceAnalog.cpp13
-rw-r--r--src/displayapp/screens/WatchFaceAnalog.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp
index b36c29d3..aedf2fc3 100644
--- a/src/displayapp/screens/WatchFaceAnalog.cpp
+++ b/src/displayapp/screens/WatchFaceAnalog.cpp
@@ -72,6 +72,10 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
lv_label_set_text_static(plugIcon, Symbols::plug);
lv_obj_align(plugIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
+ bleIcon = lv_label_create(lv_scr_act(), nullptr);
+ lv_label_set_text_static(bleIcon, "");
+ lv_obj_align(bleIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, -30, 0);
+
notificationIcon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_LIME);
lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));
@@ -204,6 +208,15 @@ void WatchFaceAnalog::Refresh() {
}
}
+ bleState = bleController.IsConnected();
+ if (bleState.IsUpdated()) {
+ if (bleState.Get()) {
+ lv_label_set_text_static(bleIcon, Symbols::bluetooth);
+ } else {
+ lv_label_set_text_static(bleIcon, "");
+ }
+ }
+
notificationState = notificationManager.AreNewNotificationsAvailable();
if (notificationState.IsUpdated()) {
diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h
index 6e4e88a3..4819be80 100644
--- a/src/displayapp/screens/WatchFaceAnalog.h
+++ b/src/displayapp/screens/WatchFaceAnalog.h
@@ -44,6 +44,7 @@ namespace Pinetime {
DirtyValue<uint8_t> batteryPercentRemaining {0};
DirtyValue<bool> isCharging {};
+ DirtyValue<bool> bleState {};
DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime;
DirtyValue<bool> notificationState {false};
@@ -68,6 +69,7 @@ namespace Pinetime {
lv_obj_t* label_date_day;
lv_obj_t* plugIcon;
lv_obj_t* notificationIcon;
+ lv_obj_t* bleIcon;
BatteryIcon batteryIcon;