elm theme - add fileman bar graph groups

This commit is contained in:
Carsten Haitzler 2023-11-04 20:44:37 +00:00
parent a4e36e6f04
commit cfa8067a32
2 changed files with 105 additions and 0 deletions

View File

@ -406,6 +406,7 @@ color_tree {
"/fg/normal/fileman/filesize/2";
"/fg/selected/fileman/filesize/2";
"/fg/normal/fileperm/execute";
"/fg/normal/filegraph/bar";
}
":selected-alt-trans" {
"/bg/normal/access";
@ -475,6 +476,7 @@ color_tree {
"/fg/normal/fileman/mount/off";
"/fg/normal/progress/busy/2";
"/fg/normal/gadgets/packagekit/pkg/low-priority";
"/fg/normal/filegraph/bartop";
}
":light-high" {
"/fg/normal/naviframe/top/overlap";

View File

@ -1219,6 +1219,109 @@ group { name: "e/fileman/default/circle";
}
}
group { name: "e/fileman/default/graph/base";
parts {
part { name: "e.swallow.content"; type: SWALLOW; scale;
description { state: "default" 0.0; offscale;
rel1 { offset: 2 2; }
rel2 { offset: -3 -3; }
}
}
}
}
group { name: "e/fileman/default/graph/bar";
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)) {
new cc[256];
getsarg(2, cc, 255);
custom_state(PART:"base", "default", 0.0);
if (!strncmp(cc, "cc:", 3)) {
strcpy(cc, cc[3]);
set_state_val(PART:"base", STATE_COLOR, 255, 255, 255, 255);
set_state_val(PART:"base", STATE_COLOR_CLASS, cc);
} 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);
}
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);
}
}
}
parts {
part { name: "drag_base"; type: SPACER; scale;
description { state: "default" 0.0; offscale;
rel1 { offset: 1 1; }
rel2 { offset: -2 -2; }
}
}
part { name: "base"; type: RECT;
description { state: "default" 0.0;
rel1.to_y: "e.dragable.value";
rel2.to: "drag_base";
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: "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;
}
}
}
}
group { name: "e/fileman/default/list/detailed";
inherit: "e/fileman/default/list/variable";
parts {