New theme for the new cpu gadget

This commit is contained in:
Davide Andreoli 2017-01-08 20:32:27 +01:00
parent 127c1c88aa
commit dfd0e5d665
18 changed files with 77 additions and 126 deletions

View File

@ -221,7 +221,10 @@ elementary/themes/img/col_sel_end_bottom.png \
elementary/themes/img/col_sel_end_left.png \
elementary/themes/img/col_sel_end_right.png \
elementary/themes/img/col_sel_end_top.png \
elementary/themes/img/cpu_icon.png \
elementary/themes/img/cpu_bar.png \
elementary/themes/img/cpu_green_on.png \
elementary/themes/img/cpu_red_on.png \
elementary/themes/img/cpu_yellow_on.png \
elementary/themes/img/darken_rounded_square_half_h.png \
elementary/themes/img/darken_rounded_square_half.png \
elementary/themes/img/darken_rounded_square.png \
@ -572,17 +575,6 @@ elementary/themes/img/pointer_glow.png \
elementary/themes/img/pointer_mono.png \
elementary/themes/img/pointer.png \
elementary/themes/img/pointer_hand1.png \
elementary/themes/img/meter_00.png \
elementary/themes/img/meter_01.png \
elementary/themes/img/meter_02.png \
elementary/themes/img/meter_03.png \
elementary/themes/img/meter_04.png \
elementary/themes/img/meter_05.png \
elementary/themes/img/meter_06.png \
elementary/themes/img/meter_07.png \
elementary/themes/img/meter_08.png \
elementary/themes/img/meter_09.png \
elementary/themes/img/meter_10.png \
elementary/themes/img/ring_shadow.png \
elementary/themes/img/ring_white_blue_glow.png \
elementary/themes/img/ring_white_middle.png \

View File

@ -1,129 +1,88 @@
group { name: "e/modules/cpumonitor/main";
image: "cpu_icon.png" COMP;
image: "mem_icon.png" COMP;
image: "meter_00.png" COMP;
image: "meter_01.png" COMP;
image: "meter_02.png" COMP;
image: "meter_03.png" COMP;
image: "meter_04.png" COMP;
image: "meter_05.png" COMP;
image: "meter_06.png" COMP;
image: "meter_07.png" COMP;
image: "meter_08.png" COMP;
image: "meter_09.png" COMP;
image: "meter_10.png" COMP;
image: "cpu_bar.png" COMP;
image: "cpu_green_on.png" COMP;
image: "cpu_yellow_on.png" COMP;
image: "cpu_red_on.png" COMP;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1)) {
new status = getarg(2);
new text[16];
if (status == 0)
set_state(PART:"meter", "default", 0.0);
else if (status > 0 && status < 10)
set_state(PART:"meter", "default", 0.1);
else if (status >= 10 && status < 20)
set_state(PART:"meter", "default", 0.2);
else if (status >= 20 && status < 30)
set_state(PART:"meter", "default", 0.3);
else if (status >= 30 && status < 40)
set_state(PART:"meter", "default", 0.4);
else if (status >= 40 && status < 50)
set_state(PART:"meter", "default", 0.5);
else if (status >= 50 && status < 60)
set_state(PART:"meter", "default", 0.6);
else if (status >= 60 && status < 70)
set_state(PART:"meter", "default", 0.7);
else if (status >= 70 && status < 80)
set_state(PART:"meter", "default", 0.8);
else if (status >= 80 && status < 90)
set_state(PART:"meter", "default", 0.9);
else if (status >= 90 && status <= 100)
set_state(PART:"meter", "default", 1.0);
snprintf(text, sizeof(text), "CPU: %i %%", status);
set_text(PART:"status", text);
new val = getarg(2);
if (val > (100 / 7 * 1)) set_state(PART:"led1", "on", 0.0);
else set_state(PART:"led1", "off", 0.0);
if (val > (100 / 7 * 2)) set_state(PART:"led2", "on", 0.0);
else set_state(PART:"led2", "off", 0.0);
if (val > (100 / 7 * 3)) set_state(PART:"led3", "on", 0.0);
else set_state(PART:"led3", "off", 0.0);
if (val > (100 / 7 * 4)) set_state(PART:"led4", "on", 0.0);
else set_state(PART:"led4", "off", 0.0);
if (val > (100 / 7 * 5)) set_state(PART:"led5", "on", 0.0);
else set_state(PART:"led5", "off", 0.0);
if (val > (100 / 7 * 6)) set_state(PART:"led6", "on", 0.0);
else set_state(PART:"led6", "off", 0.0);
}
}
}
parts {
part { name: "fade_clip"; type: RECT;
description { state: "default" 0.0;
color: 255 255 255 255;
}
}
part { name: "base";
clip_to: "fade_clip";
description { state: "default" 0.0;
aspect: 1.0 1.0;
part { name: "bg";
desc { "default";
aspect: (10 / 54) (10 / 54);
aspect_preference: BOTH;
image.normal: "cpu_icon.png";
image.normal: "cpu_bar.png";
}
}
part { name: "meter";
clip_to: "fade_clip";
description { state: "default" 0.0;
rel1.relative: 0.1 0.4;
rel2.relative: 0.9 0.6;
image.normal: "meter_00.png";
color: 255 255 255 190;
}
description { state: "default" 0.1;
inherit: "default" 0.0;
image.normal: "meter_01.png";
}
description { state: "default" 0.2;
inherit: "default" 0.0;
image.normal: "meter_02.png";
}
description { state: "default" 0.3;
inherit: "default" 0.0;
image.normal: "meter_03.png";
}
description { state: "default" 0.4;
inherit: "default" 0.0;
image.normal: "meter_04.png";
}
description { state: "default" 0.5;
inherit: "default" 0.0;
image.normal: "meter_05.png";
}
description { state: "default" 0.6;
inherit: "default" 0.0;
image.normal: "meter_06.png";
}
description { state: "default" 0.7;
inherit: "default" 0.0;
image.normal: "meter_07.png";
}
description { state: "default" 0.8;
inherit: "default" 0.0;
image.normal: "meter_08.png";
}
description { state: "default" 0.9;
inherit: "default" 0.0;
image.normal: "meter_09.png";
}
description { state: "default" 1.0;
inherit: "default" 0.0;
image.normal: "meter_10.png";
}
}
part { name: "status"; type: TEXT; mouse_events: 0;
scale: 1;
effect: SHADOW BOTTOM;
clip_to: "fade_clip";
description { state: "default" 0.0;
color_class: "module_label";
color3: 255 255 255 255;
rel1.relative: 0.1 0.0;
rel2.relative: 0.9 1.0;
text { font: FNBOLD;
fit: 1 1;
elipsis: -1;
align: 0.5 0.5;
text_class: "module_small";
part { name: "led1";
desc { "default"; hid;
rel1.relative: 0.0 (1.0 / 6 * 5);
rel2.relative: 1.0 (1.0 / 6 * 6);
image.normal: "cpu_green_on.png";
}
desc { "on"; inherit: "default"; vis; }
desc { "off"; inherit: "default"; hid; }
}
part { name: "led2";
desc { "default"; hid;
rel1.relative: 0.0 (1.0 / 6 * 4);
rel2.relative: 1.0 (1.0 / 6 * 5);
image.normal: "cpu_green_on.png";
}
desc { "on"; inherit: "default"; vis; }
desc { "off"; inherit: "default"; hid; }
}
part { name: "led3";
desc { "default"; hid;
rel1.relative: 0.0 (1.0 / 6 * 3);
rel2.relative: 1.0 (1.0 / 6 * 4);
image.normal: "cpu_green_on.png";
}
desc { "on"; inherit: "default"; vis; }
desc { "off"; inherit: "default"; hid; }
}
part { name: "led4";
desc { "default"; hid;
rel1.relative: 0.0 (1.0 / 6 * 2);
rel2.relative: 1.0 (1.0 / 6 * 3);
image.normal: "cpu_yellow_on.png";
}
desc { "on"; inherit: "default"; vis; }
desc { "off"; inherit: "default"; hid; }
}
part { name: "led5";
desc { "default"; hid;
rel1.relative: 0.0 (1.0 / 6 * 1);
rel2.relative: 1.0 (1.0 / 6 * 2);
image.normal: "cpu_yellow_on.png";
}
desc { "on"; inherit: "default"; vis; }
desc { "off"; inherit: "default"; hid; }
}
part { name: "led6";
desc { "default"; hid;
rel1.relative: 0.0 (1.0 / 6 * 0);
rel2.relative: 1.0 (1.0 / 6 * 1);
image.normal: "cpu_red_on.png";
}
desc { "on"; inherit: "default"; vis; }
desc { "off"; inherit: "default"; hid; }
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB