This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efm2.
View the commit online.
commit 2d6d9422bf6d732fbfede0db08a59dbed975402b
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Sun Nov 5 20:20:00 2023 +0000
graphs - support multi graphs per cell and gfix vertical inversion of val
---
src/backends/table/open | 2 +-
src/efm/efm_graph.c | 2 +-
src/efm/efm_util.c | 64 ++++++++++++++++++++++++++++---------------------
3 files changed, 39 insertions(+), 29 deletions(-)
diff --git a/src/backends/table/open b/src/backends/table/open
index deb8b8b..ffe4c3f 100755
--- a/src/backends/table/open
+++ b/src/backends/table/open
@@ -156,7 +156,7 @@ function handle_cmd_dir_set() {
D="detail-format=text,text,text,text,bargraph,bargraph"
e_val_escape F ${DIR}"zzzz1"
e_cmd "file-add path="${F}" "${M}" "${D}\
- " detail1=a detail2=b detail3=c detail4=d detail5=0-100,50,70,80,100,15,30,70,65,62,61,55,43,10,14,17,50 detail6=#e343ff88,0-10,3,4,0,4,10,8"
+ " detail1=a detail2=b detail3=c detail4=d detail5=0-100,50,70,80,100,15,30,70,65,62,61,55,43,10,14,17,50 detail6=#ff443388,0-10,3,4,0,4,10,8|#ffee3388,0-10,1,5,9,10,7,6"
D="detail-format=text,text,text,text,text,text"
e_val_escape F ${DIR}"zzzz2"
diff --git a/src/efm/efm_graph.c b/src/efm/efm_graph.c
index 96822e6..8d6348c 100644
--- a/src/efm/efm_graph.c
+++ b/src/efm/efm_graph.c
@@ -166,7 +166,7 @@ _smart_calculate(Evas_Object *obj)
if (range <= 1.0) range = 1.0;
for (i = 0; i < sd->num; i++)
{
- v = (double)(sd->vals[i] - sd->min) / range;
+ v = 1.0 - ((double)(sd->vals[i] - sd->min) / range);
if (sd->colorspec)
{
msg.str = (char *)sd->colorspec;
diff --git a/src/efm/efm_util.c b/src/efm/efm_util.c
index fd7170b..13a73fd 100644
--- a/src/efm/efm_util.c
+++ b/src/efm/efm_util.c
@@ -1709,43 +1709,53 @@ _icon_detail_add(Icon *icon, Smart_Data *sd, Evas *e,
free(plist);
}
else if (!strcmp(format, "bargraph"))
- { // format: "0-100,13,23,80,100,78,17,0,35,57" = min-max,val1,val2,...
- char **plist, **p, *cc = NULL;
+ { // format: "0-100,13,23,80,100,78,17,0,35,57" = min-max,val1,val2,...
+ // format: "#ff3810ff,0-100,10,20"
+ // format: "cc::selected,0-100,10,20"
+ // format: "#ffee4466,0-100,65,85,100,93|#ff882266,0-100,20,55,90,30"
+ char **plist2, **p2, **plist, **p, *cc;
int min, max, num, *vals, start;
- plist = eina_str_split(detail, ",", -1);
- if (plist[0] && plist[1])
+ plist2 = eina_str_split(detail, "|", -1);
+ o = _icon_detail_grid_add(icon, sd, col);
+ for (p2 = plist2; *p2; p2++)
{
- start = 0;
- if ((plist[0][0] == '#') || (plist[0][0] == 'c'))
+ plist = eina_str_split(*p2, ",", -1);
+ if (plist[0] && plist[1])
{
- start++;
- cc = plist[0];
- }
- if (sscanf(plist[start], "%i-%i", &min, &max) == 2)
- {
- for (num = -1, p = plist + start; *p; p++) num++;
-
- if (num > 0)
+ start = 0;
+ cc = NULL;
+ if ((plist[0][0] == '#') || (plist[0][0] == 'c'))
{
- vals = malloc(num * sizeof(int));
- for (num = -1, p = plist + start; *p; p++)
+ start++;
+ cc = plist[0];
+ }
+ if (sscanf(plist[start], "%i-%i", &min, &max) == 2)
+ {
+ for (num = -1, p = plist + start; *p; p++) num++;
+
+ if (num > 0)
{
- if (num >= 0) vals[num] = atoi(*p);
- num++;
+ vals = malloc(num * sizeof(int));
+ for (num = -1, p = plist + start; *p; p++)
+ {
+ if (num >= 0) vals[num] = atoi(*p);
+ num++;
+ }
+ o = efm_graph_add(o);
+ if (cc) efm_graph_colorspec_set(o, cc);
+ efm_graph_values_set(o, num, vals, min, max);
+ elm_grid_pack(icon->o_list_detail_swallow[col], o, 0, 0, 1, 1);
+ evas_object_show(o);
+ free(vals);
}
- o = _icon_detail_grid_add(icon, sd, col);
- o = efm_graph_add(o);
- if (cc) efm_graph_colorspec_set(o, cc);
- efm_graph_values_set(o, num, vals, min, max);
- elm_grid_pack(icon->o_list_detail_swallow[col], o, 0, 0, 1, 1);
- evas_object_show(o);
- free(vals);
}
}
+ free(*plist);
+ free(plist);
}
- free(*plist);
- free(plist);
+ free(*plist2);
+ free(plist2);
}
else
fprintf(stderr, "Uknown format for file '%s' column %i format '%s'\n",
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.