diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index 80a1c8b9b5..836a77e65c 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -249,7 +249,15 @@ void WatchFaceAnalog::Refresh() { notificationState = notificationManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { - lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); + if (notificationState.Get()) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else if (notificationManager.NbNotifications() > 0) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFFFF)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else { + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false)); + } } currentDateTime = dateTimeController.CurrentDateTime(); diff --git a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp index c695f852fe..e5dd473825 100644 --- a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp +++ b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp @@ -219,7 +219,15 @@ void WatchFaceCasioStyleG7710::Refresh() { notificationState = notificatioManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { - lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); + if (notificationState.Get()) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else if (notificatioManager.NbNotifications() > 0) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFFFF)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else { + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false)); + } } currentDateTime = std::chrono::time_point_cast(dateTimeController.CurrentDateTime()); diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 2e00ee9819..3bc61a8031 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -98,7 +98,15 @@ void WatchFaceDigital::Refresh() { notificationState = notificationManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { - lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); + if (notificationState.Get()) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else if (notificationManager.NbNotifications() > 0) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFFFF)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else { + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false)); + } } currentDateTime = std::chrono::time_point_cast(dateTimeController.CurrentDateTime()); diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp index 4c6fc196ac..3b503a66f8 100644 --- a/src/displayapp/screens/WatchFaceInfineat.cpp +++ b/src/displayapp/screens/WatchFaceInfineat.cpp @@ -393,7 +393,7 @@ void WatchFaceInfineat::UpdateSelected(lv_obj_t* object, lv_event_t event) { void WatchFaceInfineat::Refresh() { notificationState = notificationManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { - lv_obj_set_hidden(notificationIcon, !notificationState.Get()); + lv_obj_set_hidden(notificationIcon, !(notificationState.Get() || (notificationManager.NbNotifications() > 0))); lv_obj_align(notificationIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0); } diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp index e56031f74a..9c314375a5 100644 --- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp +++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp @@ -444,6 +444,18 @@ void WatchFacePineTimeStyle::SetBatteryIcon() { batteryIcon.SetBatteryPercentage(batteryPercent); } +void WatchFacePineTimeStyle::AlignIcons() { + bool notif = notificationState.Get() || notificationNbState.Get(); + if (notif && bleState.Get()) { + lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25); + lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25); + } else if (notif && !bleState.Get()) { + lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); + } else { + lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); + } +} + void WatchFacePineTimeStyle::Refresh() { isCharging = batteryController.IsCharging(); if (isCharging.IsUpdated()) { @@ -471,8 +483,18 @@ void WatchFacePineTimeStyle::Refresh() { } notificationState = notificationManager.AreNewNotificationsAvailable(); - if (notificationState.IsUpdated()) { - lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); + notificationNbState = notificationManager.NbNotifications() > 0; + if (notificationState.IsUpdated() || notificationNbState.IsUpdated()) { + if (notificationState.Get()) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFFFF)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else if (notificationNbState.Get()) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000)); + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } else { + lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(true)); + } + AlignIcons(); } currentDateTime = dateTimeController.CurrentDateTime(); diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.h b/src/displayapp/screens/WatchFacePineTimeStyle.h index 72537095f9..47a1dabf42 100644 --- a/src/displayapp/screens/WatchFacePineTimeStyle.h +++ b/src/displayapp/screens/WatchFacePineTimeStyle.h @@ -61,6 +61,7 @@ namespace Pinetime { Utility::DirtyValue> currentDateTime {}; Utility::DirtyValue stepCount {}; Utility::DirtyValue notificationState {}; + Utility::DirtyValue notificationNbState {}; Utility::DirtyValue> currentWeather {}; static Pinetime::Controllers::Settings::Colors GetNext(Controllers::Settings::Colors color); diff --git a/src/displayapp/screens/WatchFaceTerminal.cpp b/src/displayapp/screens/WatchFaceTerminal.cpp index 96d77741fd..40714245bc 100644 --- a/src/displayapp/screens/WatchFaceTerminal.cpp +++ b/src/displayapp/screens/WatchFaceTerminal.cpp @@ -98,6 +98,10 @@ void WatchFaceTerminal::Refresh() { notificationState = notificationManager.AreNewNotificationsAvailable(); if (notificationState.IsUpdated()) { if (notificationState.Get()) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00)); + lv_label_set_text_static(notificationIcon, "You have mail."); + } else if (notificationManager.NbNotifications() > 0) { + lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFFFF)); lv_label_set_text_static(notificationIcon, "You have mail."); } else { lv_label_set_text_static(notificationIcon, "");