]> git.earman.xyz Git - sensor-watch.git/commitdiff
faces/alarm: fix 24h indication in 024h mode
authorMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Mon, 16 Sep 2024 17:42:43 +0000 (14:42 -0300)
committerMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Mon, 16 Sep 2024 17:42:43 +0000 (14:42 -0300)
The watch was not indicating to the user that it was in 24h mode
when set to the leading zero 024h time format. This could lead
to ambiguity and confusion, so make sure to indicate 24h mode.

Closes #476.

Reported-by: CarpeNoctem <cryptomax@pm.me>
GitHub-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/476

movement/watch_faces/complication/alarm_face.c

index c733c2064f967659621bd1707c29f8ee6515a536..fcf9c11065941efdb57cd27f3326b0716089a33e 100644 (file)
@@ -82,11 +82,16 @@ static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state
             watch_clear_indicator(WATCH_INDICATOR_PM);
         }
         if (h == 0) h = 12;
-    } else if (!settings->bit.clock_24h_leading_zero) {
+    } else {
         watch_set_indicator(WATCH_INDICATOR_24H);
-    } else if (h < 10) {
-        set_leading_zero = true;
+
+        if (settings->bit.clock_24h_leading_zero) {
+            if (h < 10) {
+                set_leading_zero = true;
+            }
+        }
     }
+
     sprintf(buf, "%c%c%2d%2d%02d  ",
         _dow_strings[i][0], _dow_strings[i][1],
         (state->alarm_idx + 1),