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

git pushed a commit to branch main
in repository engage.

View the commit online.

commit addbf2bfcfba390da76d78720805daa490e53965
Author: Alastair Poole <[email protected]>
AuthorDate: Tue Dec 1 16:03:44 2026 +0000

    theme clocks
---
 e_mod_main.c      |  23 ++++
 e_mod_main.h      |  14 +++
 engage_clock.c    | 318 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 engage_settings.c |  92 +++++++++++-----
 4 files changed, 402 insertions(+), 45 deletions(-)

diff --git a/e_mod_main.c b/e_mod_main.c
index 6282825..8cf978b 100644
--- a/e_mod_main.c
+++ b/e_mod_main.c
@@ -19,6 +19,7 @@ typedef struct
    int dock_location;
    int dock_auto_hide;
    int dock_clock;
+   int dock_clock_theme;
    int dock_animations_disabled;
    int dock_previews_disabled;
    int dock_preview_animation_enabled;
@@ -126,6 +127,27 @@ engage_config_dock_clock_set(Eina_Bool enabled)
    engage_docks_refresh();
 }
 
+Engage_Clock_Theme
+engage_config_dock_clock_theme_get(void)
+{
+   int theme = config->dock_clock_theme;
+
+   if (theme < 0 || theme >= ENGAGE_CLOCK_THEME_COUNT)
+     return ENGAGE_CLOCK_CRAZY_LAB;
+   return theme;
+}
+
+void
+engage_config_dock_clock_theme_set(Engage_Clock_Theme theme)
+{
+   if ((unsigned int)theme >= ENGAGE_CLOCK_THEME_COUNT ||
+       engage_config_dock_clock_theme_get() == theme)
+     return;
+   config->dock_clock_theme = theme;
+   e_config_save_queue();
+   if (engage_config_dock_clock_get()) engage_docks_refresh();
+}
+
 Eina_Bool
 engage_config_dock_animations_get(void)
 {
@@ -241,6 +263,7 @@ config_init(void)
         E_CONFIG_VAL(config_descriptor, Engage_Config, dock_location, INT);
         E_CONFIG_VAL(config_descriptor, Engage_Config, dock_auto_hide, INT);
         E_CONFIG_VAL(config_descriptor, Engage_Config, dock_clock, INT);
+        E_CONFIG_VAL(config_descriptor, Engage_Config, dock_clock_theme, INT);
         E_CONFIG_VAL(config_descriptor, Engage_Config, dock_animations_disabled, INT);
         E_CONFIG_VAL(config_descriptor, Engage_Config, dock_previews_disabled, INT);
         E_CONFIG_VAL(config_descriptor, Engage_Config, dock_preview_animation_enabled, INT);
diff --git a/e_mod_main.h b/e_mod_main.h
index cb5ce57..f2c00d2 100644
--- a/e_mod_main.h
+++ b/e_mod_main.h
@@ -22,6 +22,20 @@ Engage_Dock_Location engage_config_dock_location_get(void);
 
 void engage_config_dock_location_set(Engage_Dock_Location location);
 
+typedef enum
+{
+   ENGAGE_CLOCK_CRAZY_LAB,
+   ENGAGE_CLOCK_MIDNIGHT,
+   ENGAGE_CLOCK_ATELIER,
+   ENGAGE_CLOCK_OBSERVATORY,
+   ENGAGE_CLOCK_ELEMENTARY,
+   ENGAGE_CLOCK_THEME_COUNT
+} Engage_Clock_Theme;
+
+Engage_Clock_Theme engage_config_dock_clock_theme_get(void);
+void engage_config_dock_clock_theme_set(Engage_Clock_Theme theme);
+const char *engage_clock_theme_name_get(Engage_Clock_Theme theme);
+
 Eina_Bool engage_config_dock_auto_hide_get(void);
 Eina_Bool engage_config_dock_clock_get(void);
 void engage_config_dock_clock_set(Eina_Bool enabled);
diff --git a/engage_clock.c b/engage_clock.c
index 37dfa66..b21285c 100644
--- a/engage_clock.c
+++ b/engage_clock.c
@@ -99,6 +99,272 @@ clock_rotate(Evas_Vg_Node *node, double turns)
    evas_vg_node_transformation_set(node, &matrix);
 }
 
+typedef struct
+{
+   const char *name;
+   const char *case_path;
+   const char *dial_path;
+   const char *detail_path;
+   const char *reflection_path;
+   const char *second_path;
+   const char *quarter_path;
+   const char *tick_path;
+   const char *hour_path;
+   const char *minute_path;
+   unsigned int shadow, midtone, accent, highlight;
+   Eina_Bool light_dial;
+} Clock_Design;
+
+/* The four colors in each entry come from icons/recolor-icons.py. */
+static const Clock_Design clock_designs[ENGAGE_CLOCK_THEME_COUNT] = {
+   [ENGAGE_CLOCK_CRAZY_LAB] = { .name = "Crazy Lab" },
+   [ENGAGE_CLOCK_MIDNIGHT] = { .name = "Midnight" },
+   [ENGAGE_CLOCK_ATELIER] = {
+      .name = "Atelier",
+      .case_path = "M64 4 C98 4 124 29 124 64 C124 100 100 124 64 124 "
+                   "C28 124 4 100 4 64 C4 29 30 4 64 4 Z",
+      .dial_path = "M64 15 A49 49 0 1 1 64 113 A49 49 0 1 1 64 15 Z",
+      .detail_path = "M21 64 A43 43 0 0 1 107 64 A43 43 0 0 1 21 64 Z "
+                     "M22 64 A42 42 0 0 0 106 64 A42 42 0 0 0 22 64 Z",
+      .reflection_path = "M27 49 C35 28 54 20 76 24 C55 24 39 34 27 49 Z",
+      .second_path = "M64 33 Q66.5 61 64 70 A3 3 0 1 1 64 76 A3 3 0 0 1 62 71 Z",
+      .quarter_path = "M57 24 Q64 19 71 24 Q64 30 57 24 Z",
+      .tick_path = "M61.5 25 A2.5 2.5 0 1 0 66.5 25 A2.5 2.5 0 1 0 61.5 25 Z",
+      .hour_path = "M64 41 Q75 52 64 69 Q53 52 64 41 Z",
+      .minute_path = "M64 30 Q71 43 64 71 Q57 43 64 30 Z",
+      .shadow = 0x352a27, .midtone = 0x806457, .accent = 0xbf896c,
+      .highlight = 0xfff6e4, .light_dial = EINA_TRUE
+   },
+   [ENGAGE_CLOCK_OBSERVATORY] = {
+      .name = "Observatory",
+      .case_path = "M50 4 H78 L82 12 A55 55 0 0 1 116 46 L124 50 V78 "
+                   "L116 82 A55 55 0 0 1 82 116 L78 124 H50 L46 116 "
+                   "A55 55 0 0 1 12 82 L4 78 V50 L12 46 A55 55 0 0 1 46 12 Z",
+      .dial_path = "M64 13 A51 51 0 1 1 64 115 A51 51 0 1 1 64 13 Z",
+      .detail_path = "M64 33 A31 31 0 1 1 64 95 A31 31 0 1 1 64 33 Z "
+                     "M64 35 A29 29 0 1 0 64 93 A29 29 0 1 0 64 35 Z",
+      .reflection_path = "M23 48 C32 27 55 17 77 24 C54 21 35 33 23 48 Z",
+      .second_path = "M64 29 L66 36 H65 V75 H67 V78 H61 V75 H63 V36 H62 Z",
+      .quarter_path = "M58 19 H70 V22 H66 V29 H62 V22 H58 Z",
+      .tick_path = "M63 20 H65 V26 H63 Z",
+      .hour_path = "M59 44 H69 V65 L64 71 L59 65 Z",
+      .minute_path = "M64 29 L68 40 V67 L64 73 L60 67 V40 Z",
+      .shadow = 0x101927, .midtone = 0x32465e, .accent = 0x72dbd0,
+      .highlight = 0xe7fff7
+   },
+   [ENGAGE_CLOCK_ELEMENTARY] = {
+      .name = "Default Elementary",
+      .case_path = "M28 5 H100 Q123 5 123 28 V100 Q123 123 100 123 H28 "
+                   "Q5 123 5 100 V28 Q5 5 28 5 Z",
+      .dial_path = "M29 12 H99 Q116 12 116 29 V99 Q116 116 99 116 H29 "
+                   "Q12 116 12 99 V29 Q12 12 29 12 Z",
+      .detail_path = "M23 20 H105 L103 22 H25 Z M25 106 H103 L105 108 H23 Z",
+      .reflection_path = "M23 34 Q23 21 36 21 H91 L87 23 H36 Q26 23 23 34 Z",
+      .second_path = "M63 32 H65 V75 H63 Z",
+      .quarter_path = "M61 22 H67 V32 H61 Z",
+      .tick_path = "M62.5 23 H65.5 V29 H62.5 Z",
+      .hour_path = "M59 44 H69 V69 H59 Z",
+      .minute_path = "M61 34 H67 V70 H61 Z",
+      .shadow = 0x202020, .midtone = 0x505050, .accent = 0xa5a5a5,
+      .highlight = 0xf4f4f4, .light_dial = EINA_TRUE
+   }
+};
+
+const char *
+engage_clock_theme_name_get(Engage_Clock_Theme theme)
+{
+   return clock_designs[theme].name;
+}
+
+static Evas_Vg_Shape *
+clock_path(Evas_Vg_Container *root, const char *path, unsigned int color)
+{
+   Evas_Vg_Shape *shape = evas_vg_shape_add(root);
+
+   if (!shape) return NULL;
+   evas_vg_shape_append_svg_path(shape, path);
+   evas_vg_node_color_set(shape, (color >> 16) & 255, (color >> 8) & 255,
+                         color & 255, 255);
+   return shape;
+}
+
+static Evas_Vg_Gradient_Stop
+clock_stop(double offset, unsigned int color)
+{
+   return (Evas_Vg_Gradient_Stop) {
+      offset, (color >> 16) & 255, (color >> 8) & 255, color & 255, 255
+   };
+}
+
+static Evas_Vg_Shape *
+clock_inset_path(Evas_Vg_Container *root, const char *path, unsigned int color,
+                 double scale, double y_offset)
+{
+   Evas_Vg_Shape *shape = clock_path(root, path, color);
+   double inset = CLOCK_CENTER * (1.0 - scale);
+   Eina_Matrix3 matrix = {
+      scale, 0, inset,
+      0, scale, inset + y_offset,
+      0, 0, 1
+   };
+
+   if (shape) evas_vg_node_transformation_set(shape, &matrix);
+   return shape;
+}
+
+static Eina_Bool
+clock_themed_face_add(Evas_Vg_Container *root, Engage_Clock *clock,
+                      Engage_Clock_Theme theme)
+{
+   const Clock_Design *design = &clock_designs[theme];
+   unsigned int ink = design->light_dial ? design->shadow : design->highlight;
+   unsigned int detail = design->light_dial ? design->accent : design->midtone;
+   const Evas_Vg_Gradient_Stop enamel[] = {
+      clock_stop(0.0, design->accent),
+      clock_stop(0.24, design->midtone),
+      clock_stop(0.72, design->shadow),
+      clock_stop(1.0, design->midtone)
+   };
+   const Evas_Vg_Gradient_Stop bezel[] = {
+      clock_stop(0.0, design->highlight),
+      clock_stop(0.26, design->accent),
+      clock_stop(0.56, design->midtone),
+      clock_stop(0.84, design->accent),
+      clock_stop(1.0, design->highlight)
+   };
+   const Evas_Vg_Gradient_Stop dial[] = {
+      clock_stop(0.0, design->light_dial ? design->accent : design->midtone),
+      clock_stop(0.38, design->light_dial ? design->highlight : design->shadow),
+      clock_stop(0.76, design->light_dial ? design->highlight : design->shadow),
+      clock_stop(1.0, design->light_dial ? design->accent : design->midtone)
+   };
+   const Evas_Vg_Gradient_Stop hands[] = {
+      clock_stop(0.0, ink),
+      clock_stop(0.65, ink),
+      clock_stop(1.0, design->light_dial ? design->midtone : design->accent)
+   };
+
+   if (!clock_inset_path(root, design->case_path, design->shadow, 1.0, 3.0) ||
+       !clock_finish(root, clock_path(root, design->case_path, 0xffffff),
+                     5, 123, enamel, EINA_C_ARRAY_LENGTH(enamel)) ||
+       !clock_finish(root, clock_path(root, design->dial_path, 0xffffff),
+                     12, 116, bezel, EINA_C_ARRAY_LENGTH(bezel)) ||
+       !clock_inset_path(root, design->dial_path, design->shadow, 0.94, 0.0) ||
+       !clock_finish(root, clock_inset_path(root, design->dial_path, 0xffffff,
+                                          0.90, 0.0),
+                     12, 116, dial, EINA_C_ARRAY_LENGTH(dial)) ||
+       !clock_path(root, design->detail_path, detail) ||
+       !clock_path(root, design->reflection_path,
+                   design->light_dial ? design->highlight : design->midtone))
+     return EINA_FALSE;
+
+   for (int i = 0; i < 12; i++)
+     {
+        Eina_Bool quarter = i % 3 == 0;
+        Evas_Vg_Shape *mark = clock_path(root,
+                                       quarter ? design->quarter_path : design->tick_path,
+                                       quarter ? ink :
+                                       (design->light_dial ? design->midtone : design->accent));
+        if (!mark) return EINA_FALSE;
+        clock_rotate(mark, i / 12.0);
+     }
+
+   clock->hands[0] = clock_path(root, design->hour_path, ink);
+   clock->hands[1] = clock_path(root, design->minute_path, ink);
+   clock->hands[2] = clock_path(root, design->second_path,
+                               design->light_dial ? design->midtone : design->accent);
+
+   return clock_finish(root, clock->hands[0], 41, 69, hands, EINA_C_ARRAY_LENGTH(hands)) &&
+          clock_finish(root, clock->hands[1], 30, 71, hands, EINA_C_ARRAY_LENGTH(hands)) &&
+          clock->hands[2] &&
+          clock_path(root, "M64 59 A5 5 0 1 1 64 69 A5 5 0 1 1 64 59 Z", ink) &&
+          clock_path(root, "M64 61 A3 3 0 1 1 64 67 A3 3 0 1 1 64 61 Z", design->accent);
+}
+
+static Eina_Bool
+clock_midnight_face_add(Evas_Vg_Container *root, Engage_Clock *clock)
+{
+   const char *hour = "M64 42 L69 52 L67 66 L64 70 L61 66 L59 52 Z";
+   const char *minute = "M64 32 L68 47 L66 67 L64 72 L62 67 L60 47 Z";
+   const Evas_Vg_Gradient_Stop enamel[] = {
+      { 0.00, 101, 124, 157, 255 },
+      { 0.16,  48,  65,  91, 255 },
+      { 0.69,  19,  26,  42, 255 },
+      { 1.00,  39,  55,  82, 255 }
+   };
+   const Evas_Vg_Gradient_Stop steel[] = {
+      { 0.00, 237, 244, 255, 255 },
+      { 0.23, 129, 153, 187, 255 },
+      { 0.47,  47,  64,  91, 255 },
+      { 0.72,  85, 108, 143, 255 },
+      { 1.00, 195, 215, 241, 255 }
+   };
+   const Evas_Vg_Gradient_Stop hand_steel[] = {
+      { 0.00, 248, 252, 255, 255 },
+      { 0.35, 223, 237, 255, 255 },
+      { 0.72, 154, 185, 225, 255 },
+      { 1.00, 211, 229, 252, 255 }
+   };
+   const Evas_Vg_Gradient_Stop dial[] = {
+      { 0.00,  20,  29,  49, 255 },
+      { 0.34,  45,  64,  94, 255 },
+      { 0.74,  23,  36,  59, 255 },
+      { 1.00,  12,  19,  33, 255 }
+   };
+
+   if (!clock_rect(root, 4, 8, 120, 118, 32, 10, 15, 24) ||
+       !clock_finish(root, clock_rect(root, 4, 4, 120, 118, 32, 255, 255, 255),
+                     4, 122, enamel, EINA_C_ARRAY_LENGTH(enamel)) ||
+       !clock_rect(root, 9, 11, 110, 110, 55, 9, 14, 24) ||
+       !clock_finish(root, clock_rect(root, 9, 9, 110, 110, 55, 255, 255, 255),
+                     9, 119, steel, EINA_C_ARRAY_LENGTH(steel)) ||
+       !clock_rect(root, 15, 15, 98, 98, 49, 14, 21, 34) ||
+       !clock_finish(root, clock_rect(root, 17, 17, 94, 94, 47, 255, 255, 255),
+                     17, 111, dial, EINA_C_ARRAY_LENGTH(dial)) ||
+       !clock_path(root, "M25 46 C35 23 62 15 85 26 C62 21 40 30 25 46 Z", 0x6a82a4) ||
+       !clock_path(root, "M40 102 C61 111 88 103 101 84 C91 105 63 115 40 102 Z",
+                   0x425978))
+     return EINA_FALSE;
+
+   /* Fine minute marks surround the raised, luminous hour indices. */
+   for (int i = 0; i < 60; i++)
+     {
+        Evas_Vg_Shape *mark;
+        double turns = i / 60.0;
+
+        if (i % 5 == 0)
+          {
+             const char *housing = i % 15 == 0
+                                    ? "M60 23 H68 L67 34 L64 37 L61 34 Z"
+                                    : "M61 24 H67 L66 31 L64 33 L62 31 Z";
+             mark = clock_path(root, housing, 0x0d1628);
+             if (!mark) return EINA_FALSE;
+             clock_rotate(mark, turns);
+             mark = clock_path(root, i % 15 == 0
+                                     ? "M61 23 H67 L66 32 L64 34 L62 32 Z"
+                                     : "M62 24 H66 L65 30 H63 Z",
+                               i % 15 == 0 ? 0xedf4ff : 0xaacaff);
+          }
+        else
+          mark = clock_rect(root, 63.5, 20, 1, 2.3, 0.5, 109, 137, 176);
+
+        if (!mark) return EINA_FALSE;
+        clock_rotate(mark, turns);
+     }
+
+   clock->hands[0] = clock_path(root, hour, 0xffffff);
+   clock->hands[1] = clock_path(root, minute, 0xffffff);
+   clock->hands[2] = clock_path(root, "M63.3 25 H64.7 V73 H67 V76 H61 V73 H63.3 Z",
+                               0x7bb1ff);
+   return clock_finish(root, clock->hands[0], 42, 70, hand_steel, EINA_C_ARRAY_LENGTH(hand_steel)) &&
+          clock_finish(root, clock->hands[1], 32, 72, hand_steel, EINA_C_ARRAY_LENGTH(hand_steel)) &&
+          clock->hands[2] &&
+          clock_rect(root, 59, 59, 10, 10, 5, 12, 20, 35) &&
+          clock_finish(root, clock_rect(root, 60, 60, 8, 8, 4, 255, 255, 255),
+                       60, 68, steel, EINA_C_ARRAY_LENGTH(steel)) &&
+          clock_rect(root, 62.5, 62.5, 3, 3, 1.5, 48, 65, 91);
+}
+
 static Eina_Bool
 clock_tick(void *data)
 {
@@ -129,13 +395,40 @@ clock_deleted(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
    free(clock);
 }
 
+static Eina_Bool
+clock_crazy_lab_face_add(Evas_Vg_Container *root, Engage_Clock *clock)
+{
+   Evas_Vg_Shape *tick;
+
+   if (!clock_case_add(root)) return EINA_FALSE;
+
+   for (int i = 0; i < 12; i++)
+     {
+        Eina_Bool quarter = i % 3 == 0;
+        tick = quarter ? clock_rect(root, 61.75, 26, 4.5, 9, 1.2, 44, 52, 48)
+                       : clock_rect(root, 62.5, 26, 3, 5, 0.8, 102, 81, 56);
+        if (!tick) return EINA_FALSE;
+        clock_rotate(tick, i / 12.0);
+     }
+
+   clock->hands[0] = clock_rect(root, 60.25, 43, 7.5, 26, 2, 32, 48, 49);
+   clock->hands[1] = clock_rect(root, 61.5, 35, 5, 34, 1.5, 37, 59, 60);
+   clock->hands[2] = clock_rect(root, 62.5, 29, 3, 46, 1.5, 169, 52, 31);
+   if (!clock->hands[0] || !clock->hands[1] || !clock->hands[2] ||
+       !clock_rect(root, 59.5, 59.5, 9, 9, 4.5, 108, 65, 36) ||
+       !clock_rect(root, 60.5, 60, 6.5, 6.5, 3.25, 235, 189, 113))
+     return EINA_FALSE;
+
+   return EINA_TRUE;
+}
+
 Evas_Object *
 engage_clock_add(Evas *evas)
 {
    Evas_Object *object = evas_object_vg_add(evas);
    Evas_Vg_Container *root;
-   Evas_Vg_Shape *tick;
    Engage_Clock *clock;
+   Engage_Clock_Theme theme = engage_config_dock_clock_theme_get();
 
    if (!object) return NULL;
    clock = E_NEW(Engage_Clock, 1);
@@ -151,24 +444,15 @@ engage_clock_add(Evas *evas)
    evas_object_vg_viewbox_set(object, EINA_RECT(0, 0, CLOCK_SIZE, CLOCK_SIZE));
    evas_object_vg_fill_mode_set(object, EVAS_OBJECT_VG_FILL_MODE_STRETCH);
 
-   if (!clock_case_add(root)) goto fail;
-
-   for (int i = 0; i < 12; i++)
+   if (theme == ENGAGE_CLOCK_CRAZY_LAB)
      {
-        Eina_Bool quarter = i % 3 == 0;
-        tick = quarter ? clock_rect(root, 61.75, 26, 4.5, 9, 1.2, 44, 52, 48)
-                       : clock_rect(root, 62.5, 26, 3, 5, 0.8, 102, 81, 56);
-        if (!tick) goto fail;
-        clock_rotate(tick, i / 12.0);
+        if (!clock_crazy_lab_face_add(root, clock)) goto fail;
      }
-
-   clock->hands[0] = clock_rect(root, 60.25, 43, 7.5, 26, 2, 32, 48, 49);
-   clock->hands[1] = clock_rect(root, 61.5, 35, 5, 34, 1.5, 37, 59, 60);
-   clock->hands[2] = clock_rect(root, 62.5, 29, 3, 46, 1.5, 169, 52, 31);
-   if (!clock->hands[0] || !clock->hands[1] || !clock->hands[2] ||
-       !clock_rect(root, 59.5, 59.5, 9, 9, 4.5, 108, 65, 36) ||
-       !clock_rect(root, 60.5, 60, 6.5, 6.5, 3.25, 235, 189, 113))
-     goto fail;
+   else if (theme == ENGAGE_CLOCK_MIDNIGHT)
+     {
+        if (!clock_midnight_face_add(root, clock)) goto fail;
+     }
+   else if (!clock_themed_face_add(root, clock, theme)) goto fail;
 
    clock_tick(clock);
    clock->timer = ecore_timer_add(1.0, clock_tick, clock);
diff --git a/engage_settings.c b/engage_settings.c
index 06c6e2e..67eea26 100644
--- a/engage_settings.c
+++ b/engage_settings.c
@@ -30,6 +30,49 @@ settings_auto_hide_changed(void *data EINA_UNUSED, Evas_Object *check,
    engage_config_dock_auto_hide_set(elm_check_state_get(check));
 }
 
+static void
+settings_clock_theme_changed(void *data, Evas_Object *picker, void *event EINA_UNUSED)
+{
+   Engage_Clock_Theme theme = (intptr_t)data;
+
+   elm_object_text_set(picker, engage_clock_theme_name_get(theme));
+   engage_config_dock_clock_theme_set(theme);
+}
+
+static void
+settings_option_pack(Evas_Object *table, int row, int control_span, const char *text,
+                     Evas_Object *control)
+{
+   Evas_Object *label = elm_label_add(table);
+
+   elm_object_text_set(label, text);
+   evas_object_size_hint_align_set(label, 0.0, 0.5);
+   elm_table_pack(table, label, 0, row, 1, 1);
+   evas_object_show(label);
+
+   elm_object_access_info_set(control, text);
+   evas_object_size_hint_weight_set(control, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(control, EVAS_HINT_FILL, 0.5);
+   elm_table_pack(table, control, 1, row, control_span, 1);
+   evas_object_show(control);
+}
+
+static void
+settings_clock_theme_add(Evas_Object *win, Evas_Object *table)
+{
+   Evas_Object *picker = elm_hoversel_add(table);
+
+   elm_hoversel_hover_parent_set(picker, win);
+   elm_object_text_set(picker,
+                       engage_clock_theme_name_get(engage_config_dock_clock_theme_get()));
+   for (int theme = 0; theme < ENGAGE_CLOCK_THEME_COUNT; theme++)
+     elm_hoversel_item_add(picker, engage_clock_theme_name_get(theme), NULL,
+                           ELM_ICON_NONE, settings_clock_theme_changed,
+                           (void *)(intptr_t)theme);
+
+   settings_option_pack(table, 0, 2, "Clock theme", picker);
+}
+
 static void
 settings_clock_changed(void *data EINA_UNUSED, Evas_Object *check,
                        void *event EINA_UNUSED)
@@ -55,17 +98,17 @@ static void
 settings_previews_changed(void *data, Evas_Object *check, void *event EINA_UNUSED)
 {
    Evas_Object *animation = data;
-   Evas_Object *row = elm_object_parent_widget_get(check);
+   Evas_Object *table = elm_object_parent_widget_get(check);
    Eina_Bool enabled = elm_check_state_get(check);
 
    if (enabled)
      {
-        elm_box_pack_after(row, animation, check);
+        elm_table_pack(table, animation, 2, 2, 1, 1);
         evas_object_show(animation);
      }
    else
      {
-        elm_box_unpack(row, animation);
+        elm_table_unpack(table, animation);
         evas_object_hide(animation);
      }
    engage_config_dock_previews_set(enabled);
@@ -166,7 +209,7 @@ engage_settings_open(void)
    unsigned int i;
    int margin;
 
-   Evas_Object *options_frame, *options, *auto_hide, *clock, *animations, *preview_row, *previews, *preview_animation, *slider, *close;
+   Evas_Object *options_frame, *options, *auto_hide, *clock, *animations, *appearance, *previews, *preview_animation, *slider, *close;
 
    if (settings_window)
      {
@@ -259,55 +302,48 @@ engage_settings_open(void)
    elm_box_pack_end(options, clock);
    evas_object_show(clock);
 
-   animations = elm_check_add(options);
+   appearance = elm_table_add(options);
+   elm_table_padding_set(appearance, lround(8 * e_scale), lround(10 * e_scale));
+   evas_object_size_hint_align_set(appearance, EVAS_HINT_FILL, 0.5);
+   elm_box_pack_end(options, appearance);
+   evas_object_show(appearance);
+
+   settings_clock_theme_add(win, appearance);
+
+   animations = elm_check_add(appearance);
    elm_object_style_set(animations, "toggle");
-   elm_object_text_set(animations, "Dock animations");
    elm_check_state_set(animations, engage_config_dock_animations_get());
-   evas_object_size_hint_align_set(animations, 0.0, 0.5);
    evas_object_smart_callback_add(animations, "changed", settings_animations_changed, NULL);
-   elm_box_pack_end(options, animations);
-   evas_object_show(animations);
+   settings_option_pack(appearance, 1, 1, "Dock animations", animations);
 
-   preview_row = elm_box_add(options);
-   elm_box_horizontal_set(preview_row, EINA_TRUE);
-   evas_object_size_hint_align_set(preview_row, 0.0, 0.5);
-   elm_box_pack_end(options, preview_row);
-   evas_object_show(preview_row);
-
-   previews = elm_check_add(preview_row);
+   previews = elm_check_add(appearance);
    elm_object_style_set(previews, "toggle");
-   elm_object_text_set(previews, "Live previews");
    elm_check_state_set(previews, engage_config_dock_previews_get());
-   evas_object_size_hint_align_set(previews, 0.0, 0.5);
-   elm_box_pack_end(preview_row, previews);
-   evas_object_show(previews);
+   settings_option_pack(appearance, 2, 1, "Live previews", previews);
 
-   preview_animation = elm_check_add(preview_row);
+   preview_animation = elm_check_add(appearance);
    elm_object_style_set(preview_animation, "toggle");
    elm_object_text_set(preview_animation, "Animate");
    elm_check_state_set(preview_animation, engage_config_dock_preview_animation_get());
-   evas_object_size_hint_align_set(preview_animation, 0.0, 0.5);
+   evas_object_size_hint_align_set(preview_animation, EVAS_HINT_FILL, 0.5);
    evas_object_smart_callback_add(preview_animation, "changed",
                                   settings_preview_animation_changed, NULL);
    evas_object_smart_callback_add(previews, "changed", settings_previews_changed,
                                   preview_animation);
    if (engage_config_dock_previews_get())
      {
-        elm_box_pack_end(preview_row, preview_animation);
+        elm_table_pack(appearance, preview_animation, 2, 2, 1, 1);
         evas_object_show(preview_animation);
      }
 
-   slider = elm_slider_add(options);
-   elm_object_text_set(slider, "Dock transparency");
+   slider = elm_slider_add(appearance);
    elm_slider_min_max_set(slider, 0, 100);
    elm_slider_step_set(slider, 0.01);
    elm_slider_unit_format_set(slider, "%.0f%%");
    elm_slider_indicator_format_set(slider, "%.0f%%");
    elm_slider_value_set(slider, engage_config_dock_transparency_get());
-   evas_object_size_hint_align_set(slider, EVAS_HINT_FILL, 0.5);
    evas_object_smart_callback_add(slider, "changed", settings_transparency_changed, panel);
-   elm_box_pack_end(options, slider);
-   evas_object_show(slider);
+   settings_option_pack(appearance, 3, 2, "Transparency", slider);
 
    close = elm_button_add(box);
    elm_object_text_set(close, "Done");

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

Reply via email to