This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch main
in repository eternity.

View the commit online.

commit c24422a116f6b10ff4c2aba24c597b016cafb7f0
Author: Alastair Poole <[email protected]>
AuthorDate: Sat Nov 28 04:52:26 2026 +0000

    ui: fix clock face and reduce resource consumption.
---
 README.md                                         |  16 +++------
 data/previews/elaro-midnight.png                  | Bin 60625 -> 51287 bytes
 data/previews/porcelain.png                       | Bin 74578 -> 54663 bytes
 data/previews/undertow.png                        | Bin 71699 -> 61443 bytes
 data/previews/voltage.png                         | Bin 61320 -> 70882 bytes
 data/themes/README.md                             |   6 ++--
 data/themes/folio/eternity_folio_dial.svg         |   2 +-
 data/themes/porcelain/eternity_porcelain_dial.svg |   2 +-
 src/lib/eternity.h                                |   1 -
 src/lib/eternity_ui.c                             |  42 +++++++---------------
 tests/eternity_ui_test.c                          |  12 +++----
 11 files changed, 27 insertions(+), 54 deletions(-)

diff --git a/README.md b/README.md
index 04d1c0b..19394db 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
 
 A themed clock for the Enlightenment desktop, written in C with Elementary.
 Digital and analogue clocks, timezones, alarms, a countdown timer, and a world
-daylight map. Each of the nine themes includes its own alarm sound.
+daylight map. Each of the four themes includes its own alarm sound.
 
 ## Build and run
 
@@ -30,17 +30,11 @@ Keep Eternity open for alarms to ring.
 
 ## Themes
 
-| Midnight | Porcelain |
+| Midnight | Atelier |
 | --- | --- |
-| ![Midnight theme](data/previews/elaro-midnight.png) | ![Porcelain theme](data/previews/porcelain.png) |
-| **Undertow** | **Frequency** |
-| ![Undertow theme](data/previews/undertow.png) | ![Frequency theme](data/previews/frequency.png) |
-| **Gant** | **Folio** |
-| ![Gant theme](data/previews/gant.png) | ![Folio theme](data/previews/folio.png) |
-| **Nocturne** | **Voltage** |
-| ![Nocturne theme](data/previews/nocturne.png) | ![Voltage theme](data/previews/voltage.png) |
-| **Celestial** | |
-| ![Celestial theme](data/previews/midnight.png) | |
+| ![Midnight theme](data/previews/elaro-midnight.png) | ![Atelier theme](data/previews/porcelain.png) |
+| **Observatory** | **Crazy Lab** |
+| ![Observatory theme](data/previews/undertow.png) | ![Crazy Lab theme](data/previews/voltage.png) |
 
 See [theme details](data/themes/README.md) and [translation notes](po/README).
 
diff --git a/data/previews/elaro-midnight.png b/data/previews/elaro-midnight.png
index 90f13f7..7262b09 100644
Binary files a/data/previews/elaro-midnight.png and b/data/previews/elaro-midnight.png differ
diff --git a/data/previews/porcelain.png b/data/previews/porcelain.png
index 952c7de..386cf40 100644
Binary files a/data/previews/porcelain.png and b/data/previews/porcelain.png differ
diff --git a/data/previews/undertow.png b/data/previews/undertow.png
index 10078b3..657b5ab 100644
Binary files a/data/previews/undertow.png and b/data/previews/undertow.png differ
diff --git a/data/previews/voltage.png b/data/previews/voltage.png
index 097e245..302b54c 100644
Binary files a/data/previews/voltage.png and b/data/previews/voltage.png differ
diff --git a/data/themes/README.md b/data/themes/README.md
index d910653..ea853f9 100644
--- a/data/themes/README.md
+++ b/data/themes/README.md
@@ -59,10 +59,8 @@ and add a Meson subdirectory in `data/themes/meson.build`. The menu reads the ca
 | `eternity/about` | `eternity.version` (TEXT), plus artwork and descriptive text | none |
 
 Signals use source `eternity`. The application accepts any source so theme authors
-can add alternative controls. Digital clocks use a quarter-second timer; their
-text changes once per second. Analogue clocks use a display-frame animator and
-fractional wall time for a continuous seconds sweep. Timezone conversion is cached
-for each whole second. The theme controls presentation; C controls time and storage.
+can add alternative controls. Digital and analogue clocks update once per second.
+The theme controls presentation; C controls time and storage.
 TEXT parts receive plain UTF-8, including user-entered names.
 
 Analogue cards swallow a face in `eternity.face`. `eternity/analogue/artwork`
diff --git a/data/themes/folio/eternity_folio_dial.svg b/data/themes/folio/eternity_folio_dial.svg
index bf957a5..9d819ac 100644
--- a/data/themes/folio/eternity_folio_dial.svg
+++ b/data/themes/folio/eternity_folio_dial.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><circle cx="100" cy="100" r="98" fill="#efe5ce" stroke="#c9b99c" stroke-width="2"/><circle cx="100" cy="100" r="95" fill="none" stroke="#b28b55" stroke-width=".6"/><circle cx="100" cy="100" r="79" fill="none" stroke="#b28b55" stroke-width=".6"/><path d="M100.00 18.00 100.00 8.00" stroke="#8c563c" stroke-width="1.7"/><path d="M109.20 12.48 109.62 8.50" stroke="#8c7863" stroke-width="0.7"/><path d="M118. [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><circle cx="100" cy="100" r="98" fill="#efe5ce" stroke="#c9b99c" stroke-width="2"/><circle cx="100" cy="100" r="95" fill="none" stroke="#b28b55" stroke-width=".6"/><circle cx="100" cy="100" r="79" fill="none" stroke="#b28b55" stroke-width=".6"/><path d="M100.00 18.00 100.00 8.00" stroke="#8c563c" stroke-width="1.7"/><path d="M109.20 12.48 109.62 8.50" stroke="#8c7863" stroke-width="0.7"/><path d="M118. [...]
diff --git a/data/themes/porcelain/eternity_porcelain_dial.svg b/data/themes/porcelain/eternity_porcelain_dial.svg
index 6a75ad0..d60dbe2 100644
--- a/data/themes/porcelain/eternity_porcelain_dial.svg
+++ b/data/themes/porcelain/eternity_porcelain_dial.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><circle cx="100" cy="100" r="98" fill="#f5efdf" stroke="#d8ccaf" stroke-width="2"/><circle cx="100" cy="100" r="95" fill="none" stroke="#ab8551" stroke-width=".6"/><circle cx="100" cy="100" r="79" fill="none" stroke="#ab8551" stroke-width=".6"/><path d="M100.00 18.00 100.00 8.00" stroke="#257d70" stroke-width="1.7"/><path d="M109.20 12.48 109.62 8.50" stroke="#6f8178" stroke-width="0.7"/><path d="M118. [...]
+<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><circle cx="100" cy="100" r="98" fill="#f5efdf" stroke="#d8ccaf" stroke-width="2"/><circle cx="100" cy="100" r="95" fill="none" stroke="#ab8551" stroke-width=".6"/><circle cx="100" cy="100" r="79" fill="none" stroke="#ab8551" stroke-width=".6"/><path d="M100.00 18.00 100.00 8.00" stroke="#257d70" stroke-width="1.7"/><path d="M109.20 12.48 109.62 8.50" stroke="#6f8178" stroke-width="0.7"/><path d="M118. [...]
diff --git a/src/lib/eternity.h b/src/lib/eternity.h
index 9c111b8..29eecd0 100644
--- a/src/lib/eternity.h
+++ b/src/lib/eternity.h
@@ -29,7 +29,6 @@ typedef struct
    Ecore_Event_Handler *alarm_player_handler;
    double alarm_repeat;
    Ecore_Timer *timer;
-   Ecore_Animator *animator;
    Evas_Object *tab_content;
    unsigned int tab_target;
    Eina_Bool tab_transition, tab_rebuilding;
diff --git a/src/lib/eternity_ui.c b/src/lib/eternity_ui.c
index 172b68b..2a25b7a 100644
--- a/src/lib/eternity_ui.c
+++ b/src/lib/eternity_ui.c
@@ -22,15 +22,11 @@ _eternity_ui_tick(void *data)
    Eternity *app = data;
    Eina_List *l;
    Eternity_Clock *clock;
-   double now = ecore_time_unix_get();
    Eina_Bool motion = !elm_win_iconified_get(app->win) && !elm_win_withdrawn_get(app->win);
-   time_t second;
-   double fraction;
+   time_t second = time(NULL);
    char text[128];
    double seconds, minutes, angles[3];
 
-   /* Wall time supplies fractional seconds and also corrects the hands after
-    * suspend or a system clock adjustment. Animation follows the display frames. */
    if (motion != app->motion_active)
       {
          app->motion_active = motion;
@@ -38,28 +34,24 @@ _eternity_ui_tick(void *data)
              app->frame, motion ? "eternity,motion,start" : "eternity,motion,stop", "eternity");
       }
 
-   second = (time_t)now;
-   fraction = now - (double)second;
    if (app->world) eternity_world_update(app->world, second);
 
    EINA_LIST_FOREACH (app->clocks, l, clock)
       {
-         if (!clock->time_valid || clock->last_second != second)
-            {
-               if (!eternity_clock_time_get(clock->config->zone, second, &clock->time)) continue;
+         if (clock->time_valid && clock->last_second == second) continue;
+         if (!eternity_clock_time_get(clock->config->zone, second, &clock->time)) continue;
 
-               clock->last_second = second;
-               clock->time_valid = EINA_TRUE;
-               strftime(text, sizeof(text), "%H:%M:%S", &clock->time);
-               elm_object_part_text_set(clock->layout, "eternity.time", text);
-               strftime(text, sizeof(text), _("%a, %d %b %Y"), &clock->time);
-               elm_object_part_text_set(clock->layout, "eternity.date", text);
-               elm_layout_signal_emit(clock->layout, "eternity,clock,tick", "eternity");
-            }
+         clock->last_second = second;
+         clock->time_valid = EINA_TRUE;
+         strftime(text, sizeof(text), "%H:%M:%S", &clock->time);
+         elm_object_part_text_set(clock->layout, "eternity.time", text);
+         strftime(text, sizeof(text), _("%a, %d %b %Y"), &clock->time);
+         elm_object_part_text_set(clock->layout, "eternity.date", text);
+         elm_layout_signal_emit(clock->layout, "eternity,clock,tick", "eternity");
 
          if (clock->face)
             {
-               seconds = clock->time.tm_sec + fraction;
+               seconds = clock->time.tm_sec;
                minutes = clock->time.tm_min + seconds / 60.0;
 
                angles[0] = (clock->time.tm_hour % 12) * 30.0 + minutes * 0.5;
@@ -125,12 +117,6 @@ eternity_ui_clocks_rebuild(Eternity *app)
          app->timer = NULL;
       }
 
-   if (app->animator)
-      {
-         ecore_animator_del(app->animator);
-         app->animator = NULL;
-      }
-
    EINA_LIST_FREE (app->clocks, clock)
       free(clock);
    app->alarm_status = app->alarm_hours = app->alarm_minutes = app->alarm_seconds = NULL;
@@ -200,9 +186,8 @@ eternity_ui_clocks_rebuild(Eternity *app)
                                  ? "eternity,selected"
                                  : "eternity,unselected",
                              "eternity");
-   if (app->config->analogue && !app->config->world_view && !app->alarms_view)
-      app->animator = ecore_animator_add(_eternity_ui_tick, app);
-   else app->timer = ecore_timer_add(0.25, _eternity_ui_tick, app);
+   app->timer = ecore_timer_add(app->config->world_view || app->alarms_view ? 0.25 : 1.0,
+                                _eternity_ui_tick, app);
 }
 
 void
@@ -440,7 +425,6 @@ eternity_ui_shutdown(Eternity *app)
    app->tab_transition = EINA_FALSE;
    eternity_alarm_shutdown(app);
    if (app->timer) ecore_timer_del(app->timer);
-   if (app->animator) ecore_animator_del(app->animator);
 
    EINA_LIST_FREE (app->clocks, clock)
       free(clock);
diff --git a/tests/eternity_ui_test.c b/tests/eternity_ui_test.c
index 41b8a84..db5f503 100644
--- a/tests/eternity_ui_test.c
+++ b/tests/eternity_ui_test.c
@@ -499,7 +499,7 @@ main(int argc, char **argv)
          for (analogue = 0; analogue < 2; analogue++)
             {
                eternity_mode_set(&app, analogue);
-               if (!analogue) assert(app.timer && !app.animator);
+               assert(app.timer && ecore_timer_interval_get(app.timer) == 1.0);
 
                children = elm_box_children_get(app.box);
                layout = children->data;
@@ -519,13 +519,11 @@ main(int argc, char **argv)
                      motion = (Eternity_Test_Motion){ .win = app.win,
                                                       .hand = efl_name_find(root, "second") };
                      assert(motion.hand);
-                     ecore_timer_add(0.04, _eternity_test_motion_sample, &motion);
+                     ecore_timer_add(0.16, _eternity_test_motion_sample, &motion);
                      ecore_main_loop_begin();
 
-                     /* Several different rendered positions within 320 ms:
-                      * catches a frozen hand and whole-second stepping. */
-                     assert(motion.changes >= 3);
-                     assert(app.animator && !app.timer);
+                     /* The second hand should advance once during the sample window. */
+                     assert(motion.changes == 1);
                   }
 
                eina_list_free(children);
@@ -548,7 +546,7 @@ main(int argc, char **argv)
    ecore_timer_add(0.4, _eternity_test_alarm_wait, NULL);
    ecore_main_loop_begin();
    assert(!app.tab_transition && !evas_object_freeze_events_get(app.scroller));
-   assert(app.config->world_view && !app.animator && app.timer);
+   assert(app.config->world_view && app.timer);
 
    children = elm_box_children_get(app.box);
    assert(eina_list_count(children) == 1 && children->data == app.world);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to