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

git pushed a commit to reference refs/pull/47/head
in repository efl.

View the commit online.

commit 450c3dbb2c8d7b8ce99ee0c632a4cb8a2dcfb854
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Wed Nov 13 11:45:10 2024 +0000

    theme - add bar graph updown for positive and negative bar graph
---
 data/elementary/themes/colorclasses.edc |   2 +
 data/elementary/themes/edc/graph.edc    | 145 ++++++++++++++++++++++++++++++++
 2 files changed, 147 insertions(+)

diff --git a/data/elementary/themes/colorclasses.edc b/data/elementary/themes/colorclasses.edc
index 762e7fc369..0e9bc0ba7c 100644
--- a/data/elementary/themes/colorclasses.edc
+++ b/data/elementary/themes/colorclasses.edc
@@ -440,6 +440,7 @@ color_tree {
       "/fg/normal/gadgets/temperature/hi";
       "/fg/normal/gadgets/clock/analog/hands/secs";
       "/fg/normal/fileperm/write";
+      "/fg/normal/filegraph/bar2";
    }
    ":selected4-dim" {
       "/fg/disabled/text-warning";
@@ -477,6 +478,7 @@ color_tree {
       "/fg/normal/progress/busy/2";
       "/fg/normal/gadgets/packagekit/pkg/low-priority";
       "/fg/normal/filegraph/bartop";
+      "/fg/normal/filegraph/bartop2";
    }
    ":light-high" {
       "/fg/normal/naviframe/top/overlap";
diff --git a/data/elementary/themes/edc/graph.edc b/data/elementary/themes/edc/graph.edc
index fee1f32946..0db5f3fd48 100644
--- a/data/elementary/themes/edc/graph.edc
+++ b/data/elementary/themes/edc/graph.edc
@@ -72,6 +72,16 @@ group { name: "e/fileman/default/graph/bar";
             rel2 { offset: -2 -2; }
          }
       }
+      part { name: "e.dragable.value"; type: SPACER;
+         dragable.x: 0 0 0;
+         dragable.y: 1 1 0;
+         dragable.confine: "drag_base";
+         description { state: "default" 0.0;
+            min: 0 1;
+            max: 99999 1;
+            fixed: 1 1;
+         }
+      }
       part { name: "base"; type: RECT;
          description { state: "default" 0.0;
             rel1.to_y: "e.dragable.value";
@@ -87,6 +97,98 @@ group { name: "e/fileman/default/graph/bar";
             color_class: "/fg/normal/filegraph/bartop";
          }
       }
+   }
+}
+
+group { name: "e/fileman/default/graph/barupdown";
+  alias: "e/graph/default/barupdown";
+  script {
+   hex(str[], len) {
+     new i, val = 0;
+
+     for (i = 0; i < len; i++) {
+       val <<= 4;
+       if        ((str[i] >= '0') && (str[i] <= '9')) {
+         val += str[i] - '0';
+       } else if ((str[i] >= 'a') && (str[i] <= 'f')) {
+         val += 10 + str[i] - 'a';
+       } else if ((str[i] >= 'A') && (str[i] <= 'F')) {
+         val += 10 + str[i] - 'A';
+       }
+     }
+     return val;
+   }
+   public message(Msg_Type:type, id, ...) {
+     if ((type == MSG_STRING) && ((id == 1) || (id == 2))) {
+       new cc[256];
+
+       getsarg(2, cc, 255);
+       if (!strncmp(cc, "cc:", 3)) {
+         strcpy(cc, cc[3]);
+         if (id == 1) {
+           custom_state(PART:"base", "default", 0.0);
+           set_state_val(PART:"base", STATE_COLOR, 255, 255, 255, 255);
+           set_state_val(PART:"base", STATE_COLOR_CLASS, cc);
+           set_state(PART:"base", "custom", 0.0);
+         } else {
+           custom_state(PART:"base2", "default", 0.0);
+           set_state_val(PART:"base2", STATE_COLOR, 255, 255, 255, 255);
+           set_state_val(PART:"base2", STATE_COLOR_CLASS, cc);
+           set_state(PART:"base2", "custom", 0.0);
+         }
+       } else if (!strncmp(cc, "#", 1)) {
+         new r = 255, g = 255, b = 255, a = 255;
+
+         strcpy(cc, cc[1]);
+         if        (strlen(cc) == 3) { // #35a
+           r = hex(cc[0], 1);
+           g = hex(cc[1], 1);
+           b = hex(cc[2], 1);
+         } else if (strlen(cc) == 4) { // #35af
+           r = hex(cc[0], 1);
+           g = hex(cc[1], 1);
+           b = hex(cc[2], 1);
+           a = hex(cc[3], 1);
+         } else if (strlen(cc) == 6) { // #3355aa
+           r = hex(cc[0], 2);
+           g = hex(cc[2], 2);
+           b = hex(cc[4], 2);
+         } else if (strlen(cc) == 8) { // #3355aaff
+           r = hex(cc[0], 2);
+           g = hex(cc[2], 2);
+           b = hex(cc[4], 2);
+           a = hex(cc[6], 2);
+         }
+         if (id == 1) {
+           set_state_val(PART:"base", STATE_COLOR, r, g, b, a);
+           set_state_val(PART:"base", STATE_COLOR_CLASS, "");
+           set_state(PART:"base", "custom", 0.0);
+         } else {
+           set_state_val(PART:"base2", STATE_COLOR, r, g, b, a);
+           set_state_val(PART:"base2", STATE_COLOR_CLASS, "");
+           set_state(PART:"base2", "custom", 0.0);
+         }
+       }
+     }
+   }
+  }
+   parts {
+      part { name: "drag_base"; type: SPACER; scale;
+         description { state: "default" 0.0; offscale;
+            rel1 { offset:  1  1; }
+            rel2 { offset: -2 -2; }
+         }
+      }
+      part { name: "e.dragable.zero"; type: SPACER;
+         dragable.x: 0 0 0;
+         dragable.y: 1 1 0;
+         dragable.confine: "drag_base";
+         description { state: "default" 0.0;
+            min: 0 1;
+            max: 99999 1;
+            fixed: 1 1;
+         }
+      }
       part { name: "e.dragable.value"; type: SPACER;
          dragable.x: 0 0 0;
          dragable.y: 1 1 0;
@@ -97,6 +199,49 @@ group { name: "e/fileman/default/graph/bar";
             fixed: 1 1;
          }
       }
+      part { name: "base"; type: RECT;
+         description { state: "default" 0.0;
+            rel.to: "drag_base";
+            rel1.to_y: "e.dragable.value";
+            rel2.to_y: "e.dragable.zero";
+            color_class: "/fg/normal/filegraph/bar";
+         }
+      }
+      part { name: "top"; type: RECT;
+         description { state: "default" 0.0;
+            rel.to: "base";
+            rel2.relative: 1.0 0.0;
+            rel2.offset: -1 0;
+            color_class: "/fg/normal/filegraph/bartop";
+         }
+      }
+      part { name: "base2clip"; type: RECT;
+         description { state: "default" 0.0;
+            rel.to: "drag_base";
+            rel1.to: "e.dragable.zero";
+            rel1.relative: 0.0 1.0;
+         }
+      }
+      part { name: "base2"; type: RECT;
+         clip_to: "base2clip";
+         description { state: "default" 0.0;
+            rel.to: "drag_base";
+            rel1.to_y: "e.dragable.zero";
+            rel1.relative: 0.0 1.0;
+            rel1.offset: 0 -1;
+            rel2.to_y: "e.dragable.value";
+            color_class: "/fg/normal/filegraph/bar2"; // XXXX: add to cdc
+         }
+      }
+      part { name: "top2"; type: RECT;
+         clip_to: "base2clip";
+         description { state: "default" 0.0;
+            rel.to: "base2";
+            rel1.relative: 0.0 1.0;
+            rel1.offset: 0 -1;
+            color_class: "/fg/normal/filegraph/bartop2"; // XXXX: add to cdc
+         }
+      }
    }
 }
 

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

Reply via email to