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

git pushed a commit to branch master
in repository enlightenment.

View the commit online.

commit ba06cd018811ed78f56a3cb1aa39b55338792120
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Wed Nov 13 12:02:40 2024 +0000

    add updown grqaph too for values around zero
---
 src/bin/e_graph.c | 30 +++++++++++++++++++++++++++++-
 src/bin/e_graph.h |  1 +
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_graph.c b/src/bin/e_graph.c
index e3e816303..26a0149d7 100644
--- a/src/bin/e_graph.c
+++ b/src/bin/e_graph.c
@@ -11,6 +11,7 @@ struct _Smart_Data
   int               num, min, max;
   int              *vals;
   Eina_Stringshare *colorspec;
+  Eina_Stringshare *colorspecdown;
 
   Evas_Object  *o_smart; // the smart object container itself
   Evas_Object  *o_base;
@@ -99,6 +100,7 @@ _smart_del(Evas_Object *obj)
       sd->o_base = NULL;
     }
   eina_stringshare_replace(&sd->colorspec, NULL);
+  eina_stringshare_replace(&sd->colorspecdown, NULL);
   sd->o_smart = NULL;
 
   _sc_parent.del(obj);
@@ -141,7 +143,9 @@ _smart_calculate(Evas_Object *obj)
   e = evas_object_evas_get(obj);
   evas_object_geometry_set(sd->o_base, sd->geom.x, sd->geom.y, sd->geom.w,
                            sd->geom.h);
-  grp            = "e/graph/default/bar";
+  if (sd->colorspecdown) grp = "e/graph/default/barupdown";
+  else grp = "e/graph/default/bar";
+
   theme_edj_file = elm_theme_group_path_find(NULL, grp);
 
   if ((!sd->o_vals) && (sd->num > 0))
@@ -172,10 +176,22 @@ _smart_calculate(Evas_Object *obj)
               msg.str = (char *)sd->colorspec;
               edje_object_message_send(sd->o_vals[i], EDJE_MESSAGE_STRING, 1,
                                        &msg);
+              if (sd->colorspecdown)
+                {
+                  msg.str = (char *)sd->colorspecdown;
+                  edje_object_message_send(sd->o_vals[i], EDJE_MESSAGE_STRING, 2,
+                                           &msg);
+                }
               edje_object_message_signal_process(sd->o_vals[i]);
             }
           edje_object_part_drag_value_set(sd->o_vals[i], "e.dragable.value",
                                           0.0, v);
+          if (sd->colorspecdown)
+            {
+              v = (double)(sd->max) / range;
+              edje_object_part_drag_value_set(sd->o_vals[i], "e.dragable.zero",
+                                              0.0, v);
+            }
         }
     }
   sd->reset_vals = EINA_FALSE;
@@ -235,3 +251,15 @@ e_graph_colorspec_set(Evas_Object *obj, const char *cc)
   _clear(sd);
   sd->reset_colors = EINA_TRUE;
 }
+
+E_API void
+e_graph_colorspec_down_set(Evas_Object *obj, const char *cc)
+{
+  ENTRY;
+
+  if ((!cc) && (!sd->colorspecdown)) return;
+  if ((cc) && (sd->colorspecdown) && (!strcmp(cc, sd->colorspecdown))) return;
+  eina_stringshare_replace(&sd->colorspecdown, cc);
+  _clear(sd);
+  sd->reset_colors = EINA_TRUE;
+}
diff --git a/src/bin/e_graph.h b/src/bin/e_graph.h
index c530e5b81..208f89cdf 100644
--- a/src/bin/e_graph.h
+++ b/src/bin/e_graph.h
@@ -12,5 +12,6 @@ E_API void         e_graph_values_set(Evas_Object *obj, int num, int *vals, int
 // #ff8800                - 24bit rgb val
 // #ff880044              - 32bit rgba val
 E_API void         e_graph_colorspec_set(Evas_Object *obj, const char *cc);
+E_API void         e_graph_colorspec_down_set(Evas_Object *obj, const char *cc);
 
 #endif

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

Reply via email to