summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/WatchFaceAnalog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens/WatchFaceAnalog.cpp')
-rw-r--r--src/displayapp/screens/WatchFaceAnalog.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp
index f027a744..4cfc9692 100644
--- a/src/displayapp/screens/WatchFaceAnalog.cpp
+++ b/src/displayapp/screens/WatchFaceAnalog.cpp
@@ -57,7 +57,6 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
bleController {bleController},
notificationManager {notificationManager},
settingsController {settingsController} {
- settingsController.SetClockFace(1);
sHour = 99;
sMinute = 99;
@@ -68,13 +67,13 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
lv_obj_align(bg_clock_img, NULL, LV_ALIGN_CENTER, 0, 0);
batteryIcon = lv_label_create(lv_scr_act(), nullptr);
- lv_label_set_text(batteryIcon, Symbols::batteryHalf);
+ lv_label_set_text_static(batteryIcon, Symbols::batteryHalf);
lv_obj_align(batteryIcon, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
lv_obj_set_auto_realign(batteryIcon, true);
notificationIcon = lv_label_create(lv_scr_act(), NULL);
lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00));
- lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false));
+ lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));
lv_obj_align(notificationIcon, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 0);
// Date - Day / Week day
@@ -138,9 +137,9 @@ WatchFaceAnalog::~WatchFaceAnalog() {
}
void WatchFaceAnalog::UpdateClock() {
- hour = dateTimeController.Hours();
- minute = dateTimeController.Minutes();
- second = dateTimeController.Seconds();
+ uint8_t hour = dateTimeController.Hours();
+ uint8_t minute = dateTimeController.Minutes();
+ uint8_t second = dateTimeController.Seconds();
if (sMinute != minute) {
auto const angle = minute * 6;
@@ -186,7 +185,7 @@ void WatchFaceAnalog::SetBatteryIcon() {
} else {
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
}
- lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent));
+ lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent));
}
void WatchFaceAnalog::Refresh() {
@@ -194,7 +193,7 @@ void WatchFaceAnalog::Refresh() {
if (isCharging.IsUpdated()) {
if (isCharging.Get()) {
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED);
- lv_label_set_text(batteryIcon, Symbols::plug);
+ lv_label_set_text_static(batteryIcon, Symbols::plug);
} else {
SetBatteryIcon();
}
@@ -209,15 +208,15 @@ void WatchFaceAnalog::Refresh() {
notificationState = notificationManager.AreNewNotificationsAvailable();
if (notificationState.IsUpdated()) {
- lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(notificationState.Get()));
+ lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get()));
}
currentDateTime = dateTimeController.CurrentDateTime();
if (currentDateTime.IsUpdated()) {
- month = dateTimeController.Month();
- day = dateTimeController.Day();
- dayOfWeek = dateTimeController.DayOfWeek();
+ Pinetime::Controllers::DateTime::Months month = dateTimeController.Month();
+ uint8_t day = dateTimeController.Day();
+ Pinetime::Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek();
UpdateClock();