From a306dcaa658e7df1ce8ac2cf0e6c053baf817edd Mon Sep 17 00:00:00 2001 From: John Crawford Date: Mon, 23 Oct 2023 09:31:18 -0600 Subject: [PATCH] aod: analog watchface remove second hand Sometimes the watch LCD shuts off on the analog watch face, and removing the second hand prevents the issue --- src/displayapp/screens/WatchFaceAnalog.cpp | 11 ++++++++++- src/displayapp/screens/WatchFaceAnalog.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index 2b27ad6402..b6f4f12dc5 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -203,7 +203,7 @@ void WatchFaceAnalog::UpdateClock() { lv_line_set_points(hour_body_trace, hour_point_trace, 2); } - if (sSecond != second) { + if (!alwaysOnDisplay.Get() && sSecond != second) { sSecond = second; auto const angle = second * 6; @@ -237,6 +237,15 @@ void WatchFaceAnalog::Refresh() { } } + alwaysOnDisplay = settingsController.GetAlwaysOnDisplay(); + if (alwaysOnDisplay.IsUpdated()) { + if (alwaysOnDisplay.Get()) { + lv_obj_set_hidden(second_body, true); + } else { + lv_obj_set_hidden(second_body, false); + } + } + bleState = bleController.IsConnected(); if (bleState.IsUpdated()) { if (bleState.Get()) { diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index 7e83cfcb14..74d11ea4cd 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -41,6 +41,7 @@ namespace Pinetime { Utility::DirtyValue batteryPercentRemaining {0}; Utility::DirtyValue isCharging {}; Utility::DirtyValue bleState {}; + Utility::DirtyValue alwaysOnDisplay {}; Utility::DirtyValue> currentDateTime; Utility::DirtyValue notificationState {false}; using days = std::chrono::duration>; // TODO: days is standard in c++20