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

git pushed a commit to branch master
in repository evisum.

View the commit online.

commit 8a71c66a84736d982fc72de3d22b6266eda5d6c4
Author: Alastair Poole <[email protected]>
AuthorDate: Sun Mar 29 04:31:48 2026 +0100

    visuals: use a gradient.
    
    This isn't the world's greatest visualisation but it's a wee bit
    of an improvement.
---
 src/bin/ui/visuals/cpu_bars.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/bin/ui/visuals/cpu_bars.c b/src/bin/ui/visuals/cpu_bars.c
index 7a87eb8..9c15b37 100644
--- a/src/bin/ui/visuals/cpu_bars.c
+++ b/src/bin/ui/visuals/cpu_bars.c
@@ -10,6 +10,27 @@ typedef struct {
     Evas_Object *bg;
 } Ext;
 
+static void
+_bar_gradient_apply(Evas_Object *rec, unsigned int top, unsigned int bottom) {
+    Evas_Map *map;
+
+    map = evas_map_new(4);
+    if (!map) {
+        evas_object_map_enable_set(rec, EINA_FALSE);
+        evas_object_color_set(rec, RVAL(top), GVAL(top), BVAL(top), AVAL(top));
+        return;
+    }
+
+    evas_map_util_points_populate_from_object(map, rec);
+    evas_map_point_color_set(map, 0, RVAL(top), GVAL(top), BVAL(top), AVAL(top));
+    evas_map_point_color_set(map, 1, RVAL(top), GVAL(top), BVAL(top), AVAL(top));
+    evas_map_point_color_set(map, 2, RVAL(bottom), GVAL(bottom), BVAL(bottom), AVAL(bottom));
+    evas_map_point_color_set(map, 3, RVAL(bottom), GVAL(bottom), BVAL(bottom), AVAL(bottom));
+    evas_object_map_set(rec, map);
+    evas_object_map_enable_set(rec, EINA_TRUE);
+    evas_map_free(map);
+}
+
 static void
 _core_times_main_cb(void *data, Ecore_Thread *thread) {
     int ncpu;
@@ -57,12 +78,13 @@ _core_times_feedback_cb(void *data, Ecore_Thread *thread EINA_UNUSED, void *msgd
         Core *core = &cores[i];
         Evas_Object *rec = eina_list_nth(ext->objects, i);
         evas_object_geometry_get(rec, &ox, NULL, NULL, NULL);
-        int c = temp_colormap[core->percent & 0xff];
+        unsigned int c_top = temp_colormap[core->percent & 0xff];
+        unsigned int c_bottom = temp_colormap[0];
         int h = core->percent * step;
         if (!h) h = 1;
-        evas_object_color_set(rec, RVAL(c), GVAL(c), BVAL(c), AVAL(c));
         evas_object_resize(rec, ELM_SCALE_SIZE(BAR_WIDTH), ELM_SCALE_SIZE(h));
         evas_object_move(rec, ox, oy - ELM_SCALE_SIZE(h));
+        _bar_gradient_apply(rec, c_top, c_bottom);
         elm_table_align_set(ext->tb, 0.0, 1.0);
     }
 

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

Reply via email to