Flat theme: Finish converting new gadgets.

This commit is contained in:
Stephen 'Okra' Houston 2019-01-23 15:22:22 -06:00
parent a08f678ae3
commit a427979cce
7 changed files with 651 additions and 754 deletions

View File

@ -40,6 +40,7 @@ elementary/themes/edc/comp_effects.edc \
elementary/themes/edc/conf.edc \
elementary/themes/edc/connman.edc \
elementary/themes/edc/cpufreq.edc \
elementary/themes/edc/cpuclock.edc \
elementary/themes/edc/cpumonitor.edc \
elementary/themes/edc/cslider.edc \
elementary/themes/edc/desklock.edc \
@ -82,6 +83,7 @@ elementary/themes/edc/syscon.edc \
elementary/themes/edc/systray.edc \
elementary/themes/edc/tasks.edc \
elementary/themes/edc/temperature.edc \
elementary/themes/edc/thermal.edc \
elementary/themes/edc/textblock.edc \
elementary/themes/edc/time.edc \
elementary/themes/edc/toolbar.edc \

View File

@ -139,7 +139,9 @@ collections {
#include "edc/randr.edc"
#include "edc/notification.edc"
#include "edc/cpufreq.edc"
#include "edc/cpuclock.edc"
#include "edc/temperature.edc"
#include "edc/thermal.edc"
#include "edc/backlight.edc"
#include "edc/mixer.edc"
#include "edc/battery.edc"

View File

@ -1,186 +1,65 @@
group { name: "e/gadget/batman/main";
alias: "e/gadget/batman/main_vert";
images.image: "bat_shadow.png" COMP;
images.image: "bat_base.png" COMP;
images.image: "bat_bottom0.png" COMP;
images.image: "bat_top0.png" COMP;
images.image: "batman_overlay.png" COMP;
images.image: "glow_med_white.png" COMP;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_FLOAT) && (id == 1)) {
new Float:val;
new r = 51, g = 153, b = 255;
new lr = 255, lg = 0, lb = 0;
val = getfarg(2);
if (val < 0.35) {
new Float:val1, Float:val2;
val1 = (val - 0.10) / 0.25;
val2 = 1.0 - val1;
r = round((r * val1) + (lr * val2), ROUND);
g = round((g * val1) + (lg * val2), ROUND);
b = round((b * val1) + (lb * val2), ROUND);
}
custom_state(PART:"fill", "default", 0.0);
set_state_val(PART:"fill", STATE_COLOR, r, g, b, 255);
set_state_val(PART:"fill", STATE_COLOR, r, g, b, 255);
set_state_val(PART:"fill", STATE_COLOR, r, g, b, 255);
set_state_val(PART:"fill", STATE_REL1, 0.0, 1.0 - val);
set_state(PART:"fill", "custom", 0.0);
new Float:val = getfarg(2);
val = 0.05 + (0.9 * (1.0 - val));
custom_state(PART:"fill_clip", "default", 0.0);
set_state_val(PART:"fill_clip", STATE_REL1, 0.0, val);
set_state(PART:"fill_clip", "custom", 0.0);
}
}
}
parts {
part { name: "fade_clip"; type: RECT;
part { name: "pulse_clip"; type: RECT;
description { state: "default" 0.0;
color: 255 255 255 255;
rel1.to: "bg";
rel2.to: "bg";
}
description { state: "faded" 0.0;
inherit: "default" 0.0;
color: 255 255 255 128;
}
}
part { name: "fill_clip_dim"; type: RECT;
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
color: 128 128 128 255;
}
}
part { name: "pulse_clip"; type: RECT;
clip_to: "fade_clip";
description { state: "default" 0.0;
color: 255 255 255 255;
}
description { state: "faded" 1.0;
color: 255 255 255 255;
}
description { state: "faded" 0.0;
color: 255 255 255 64;
}
}
part { name: "fill_region"; type: SPACER;
part { name: "fill_clip"; type: RECT;
clip_to: "fill_clip_dim";
description { state: "default" 0.0;
rel1.to: "bg";
rel1.offset: 1 0;
rel2.to: "bg";
rel2.offset: -2 -1;
}
}
part { name: "pwr"; type: SPACER;
description { state: "default" 0.0;
rel1.to: "bg";
rel1.relative: 0.40 0.40;
rel2.to: "bg";
rel2.relative: 0.60 0.60;
aspect: 1.0 1.0; aspect_preference: BOTH;
step: 5 5;
}
}
part { name: "base"; type: SPACER;
description { state: "default" 0.0;
aspect: 1.0 1.0; aspect_preference: BOTH;
}
}
part { name: "shadow";
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "top";
rel1.offset: -4 0;
rel2.to: "bottom";
rel2.offset: 3 3;
image.normal: "bat_shadow.png";
}
}
part { name: "bg";
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "top";
rel1.relative: 0.0 1.0;
rel2.to: "bottom";
rel2.relative: 1.0 0.0;
aspect: 1.0 1.0; aspect_preference: BOTH;
image.normal: "bat_base.png";
fill.smooth: 0;
color: 0 0 0 64;
}
}
part { name: "top";
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "base";
rel1.offset: 6 4;
rel2.to: "base";
rel2.offset: -7 4;
rel2.relative: 1.0 0.0;
aspect: (112/24) (112/24); aspect_preference: HORIZONTAL;
align: 0.5 0.0;
image.normal: "bat_top0.png";
}
}
part { name: "bottom";
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "base";
rel1.offset: 6 -5;
rel2.to: "base";
rel2.offset: -7 -5;
aspect: (112/12) (112/12); aspect_preference: HORIZONTAL;
align: 0.5 1.0;
image.normal: "bat_bottom0.png";
}
}
part { name: "fill"; mouse_events: 0;
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "fill_region";
rel1.offset: -5 -5;
rel2.to: "fill_region";
rel2.offset: 4 4;
image.normal: "glow_med_white.png";
image.border: 10 10 10 10;
color: 51 153 255 255;
}
}
part { name: "overlay";
clip_to: "pulse_clip";
part { name: "fill";
clip_to: "fill_clip";
description { state: "default" 0.0;
rel1.to: "bg";
rel1.offset: 0 0;
rel2.to: "bg";
rel2.offset: -1 -1;
image.normal: "batman_overlay.png";
image.border: 0 0 7 7;
image.normal: "bat_base.png";
color: 160 160 160 255;
}
}
part { name: "pwr1";
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "pwr";
rel1.relative: (2/5) 0.0;
rel1.offset: -5 -5;
rel2.to: "pwr";
rel2.relative: (3/5) 1.0;
rel2.offset: 4 4;
image.normal: "glow_med_white.png";
image.border: 5 5 5 5;
fill.smooth: 0;
visible: 0;
}
description { state: "visible" 0.0;
description { state: "charging" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "pwr2";
clip_to: "pulse_clip";
description { state: "default" 0.0;
rel1.to: "pwr";
rel1.relative: 0.0 (2/5);
rel1.offset: -5 -5;
rel2.to: "pwr";
rel2.relative: 1.0 (3/5);
rel2.offset: 4 4;
image.normal: "glow_med_white.png";
image.border: 5 5 5 5;
fill.smooth: 0;
visible: 0;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 51 153 255 255;
}
}
part { name: "over"; type: RECT;
@ -192,20 +71,13 @@ group { name: "e/gadget/batman/main";
programs {
program {
signal: "e,state,charging"; source: "e";
action: STATE_SET "visible" 0.0;
target: "pwr1";
target: "pwr2";
action: STATE_SET "charging" 0.0;
target: "fill";
}
program {
signal: "e,state,discharging"; source: "e";
action: STATE_SET "default" 0.0;
target: "pwr1";
target: "pwr2";
}
program {
signal: "e,state,unknown"; source: "e";
action: STATE_SET "faded" 0.0;
target: "fade_clip";
target: "fill";
}
program { name: "pulse";
signal: "e,action,pulse,start"; source: "e";
@ -215,36 +87,56 @@ group { name: "e/gadget/batman/main";
target: "pulse_clip";
}
program { name: "pulse2";
action: STATE_SET "faded" 1.0; transition: ACCELERATE 0.1;
action: STATE_SET "default" 0.0;
transition: ACCELERATE 0.1;
target: "pulse_clip";
after: "pulse";
}
program {
signal: "e,action,pulse,stop"; source: "e";
action: ACTION_STOP;
target: "pulse";
target: "pulse2";
after: "pulse3";
}
program { name: "pulse3";
signal: "e,action,pulse,stop"; source: "e";
action: STATE_SET "default" 0.0;
target: "pulse_clip";
}
program {
signal: "mouse,in"; source: "over";
action: STATE_SET "visible" 0.0;
transition: SINUSOIDAL 0.3;
target: "fill_clip_dim";
}
program {
signal: "mouse,out"; source: "over";
action: STATE_SET "default" 0.0;
transition: SINUSOIDAL 0.3;
target: "fill_clip_dim";
}
}
}
group { name: "e/gadget/batman/popup";
min: 240 60;
min: 320 60;
parts {
part { name: "e.swallow.batman"; type: SWALLOW;
description { state: "default" 0.0;
aspect: 1.0 1.0; aspect_preference: VERTICAL;
min: 1 1;
max: 160 160;
max: 240 160;
align: 0.0 0.5;
}
}
part { name: "e.text.title"; type: TEXT;
effect: SHADOW BOTTOM;
scale: 1;
description { state: "default" 0.0;
rel1.relative: 1.0 0.0;
rel1.to_x: "e.swallow.batman";
rel2.relative: 1.0 0.5;
color: FN_COL_DEFAULT;
color: 160 160 160 255;
text { font: "Sans:style=Bold"; size: 10;
text: "Your battery is low!";
min: 1 1;
@ -254,12 +146,11 @@ group { name: "e/gadget/batman/popup";
}
}
part { name: "e.text.label"; type: TEXT;
effect: SHADOW BOTTOM;
scale: 1;
description { state: "default" 0.0;
rel1.relative: 1.0 0.5;
rel1.to_x: "e.swallow.batman";
color: FN_COL_DEFAULT;
color: 160 160 160 255;
text { font: "Sans"; size: 10;
text: "AC power is recommended.";
min: 1 1;

View File

@ -0,0 +1,343 @@
group { name: "e/gadgets/cpuclock/main";
alias: "e/gadgets/cpuclock/main_vert";
images.image: "tacho_base.png" COMP;
images.image: "inset_round_hilight.png" COMP;
images.image: "inset_round_shadow.png" COMP;
images.image: "inset_round_shading.png" COMP;
set { name: "tacho_hand_big";
image { image: "tacho_hand_big.png" COMP; size: 73 73 99999 99999; }
image { image: "tacho_hand_big2.png" COMP; size: 37 37 72 72; }
image { image: "tacho_hand_big3.png" COMP; size: 19 19 36 36; }
image { image: "tacho_hand_big4.png" COMP; size: 0 0 18 18; }
}
images.image: "tacho_hand_big_shadow.png" COMP;
set { name: "tacho_hand_small_min";
image { image: "tacho_hand_small_min.png" COMP; size: 73 73 99999 99999; }
image { image: "tacho_hand_small_min2.png" COMP; size: 37 37 72 72; }
image { image: "tacho_hand_small_min3.png" COMP; size: 19 19 36 36; }
image { image: "tacho_hand_small_min4.png" COMP; size: 0 0 18 18; }
}
images.image: "tacho_hand_small_shadow.png" COMP;
set { name: "knob";
image { image: "knob_sz_24.png" COMP; size: 31 31 32 32; }
image { image: "knob_sz_22.png" COMP; size: 29 29 30 30; }
image { image: "knob_sz_20.png" COMP; size: 27 27 28 28; }
image { image: "knob_sz_18.png" COMP; size: 25 25 26 26; }
image { image: "knob_sz_16.png" COMP; size: 23 23 24 24; }
image { image: "knob_sz_14.png" COMP; size: 21 21 22 22; }
image { image: "knob_sz_12.png" COMP; size: 19 19 20 20; }
image { image: "knob_sz_10.png" COMP; size: 17 17 18 18; }
image { image: "knob_sz_08.png" COMP; size: 15 15 16 16; }
image { image: "knob_sz_06.png" COMP; size: 13 13 14 14; }
image { image: "knob_sz_04.png" COMP; size: 0 0 12 12; }
}
script {
public available_frequencies;
public available_governors;
public cur_freq_old;
public cur_freq_new;
public cur_freq_now;
public cur_freq_anim;
public min_freq_old;
public min_freq_new;
public min_freq_now;
public max_freq_old;
public max_freq_new;
public max_freq_now;
public slide_cur_freq(val, Float:v) {
new Float:freq, Float:min_freq, Float:max_freq, Float:tf;
new f, f0, f1;
v = (1.0 - cos(v * 3.141592654)) / 2.0;
min_freq = fetch_int(available_frequencies, 0);
max_freq = fetch_int(available_frequencies,
count(available_frequencies) - 1);
f0 = get_int(cur_freq_old);
f1 = get_int(cur_freq_new);
f = f1 - f0;
freq = float(f) * v;
f = round(freq);
f = f + f0;
set_int(cur_freq_now, f);
freq = (float(f) - min_freq) / (max_freq - min_freq);
tf = (freq * 225.0) - 135.0;
custom_state(PART:"meter", "default", 0.0);
set_state_val(PART:"meter", STATE_MAP_ROT_Z, tf);
set_state(PART:"meter", "custom", 0.0);
custom_state(PART:"meter_sh", "default", 0.0);
set_state_val(PART:"meter_sh", STATE_MAP_ROT_Z, tf);
set_state(PART:"meter_sh", "custom", 0.0);
f0 = get_int(min_freq_old);
f1 = get_int(min_freq_new);
f = f1 - f0;
freq = float(f) * v;
f = round(freq);
f = f + f0;
set_int(min_freq_now, f);
freq = (float(f) - min_freq) / (max_freq - min_freq);
tf = (freq * 225.0) - 135.0;
custom_state(PART:"meter_min", "default", 0.0);
set_state_val(PART:"meter_min", STATE_MAP_ROT_Z, tf);
set_state(PART:"meter_min", "custom", 0.0);
custom_state(PART:"meter_min_sh", "default", 0.0);
set_state_val(PART:"meter_min_sh", STATE_MAP_ROT_Z, tf);
set_state(PART:"meter_min_sh", "custom", 0.0);
f0 = get_int(max_freq_old);
f1 = get_int(max_freq_new);
f = f1 - f0;
freq = float(f) * v;
f = round(freq);
f = f + f0;
set_int(max_freq_now, f);
freq = (float(f) - min_freq) / (max_freq - min_freq);
tf = (freq * 225.0) - 135.0;
custom_state(PART:"meter_max", "default", 0.0);
set_state_val(PART:"meter_max", STATE_MAP_ROT_Z, tf);
set_state(PART:"meter_max", "custom", 0.0);
custom_state(PART:"meter_max_sh", "default", 0.0);
set_state_val(PART:"meter_max_sh", STATE_MAP_ROT_Z, tf);
set_state(PART:"meter_max_sh", "custom", 0.0);
if (v >= 1.0) {
set_int(cur_freq_anim, 0);
return 0;
}
return 1;
}
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1)) { // add an available freq
while (count(available_frequencies) > 0) {
remove(available_frequencies, 0);
}
for (new i = 2; i < numargs(); i++) {
append_int(available_frequencies, getarg(i));
}
}
else if ((type == MSG_STRING_SET) && (id == 2)) { // add a governor
new text[100];
while (count(available_governors) > 0) {
remove(available_governors, 0);
}
for (new i = 2; i < numargs(); i++) {
snprintf(text, 100, "%s", getarg(i));
append_str(available_governors, text);
}
} else if ((type == MSG_INT_SET) && (id == 3)) { // avg freq
new f;
new ani, curf, minf, maxf;
new text[100];
f = getarg(2);
if (f < 1000000) {
f += 500;
snprintf(text, 100, "%i", f / 1000);
} else {
f += 50000;
snprintf(text, 100, "%i.%i", f / 1000000,
(f % 1000000) / 100000);
}
set_text(PART:"readout", text);
ani = get_int(cur_freq_anim);
if (ani > 0) cancel_anim(ani);
ani = anim(0.25, "slide_cur_freq", 0);
set_int(cur_freq_anim, ani);
f = getarg(2);
curf = get_int(cur_freq_now);
set_int(cur_freq_old, curf);
set_int(cur_freq_new, f);
f = getarg(4);
minf = get_int(min_freq_now);
set_int(min_freq_old, minf);
set_int(min_freq_new, f);
f = getarg(5);
maxf = get_int(max_freq_now);
set_int(max_freq_old, maxf);
set_int(max_freq_new, f);
} else if ((type == MSG_STRING) && (id == 4)) {
new text[100];
snprintf(text, 100, "%s", getarg(2));
}
}
}
parts {
part { name: "fade_clip"; type: RECT;
description { state: "default" 0.0;
color: 255 255 255 255;
}
description { state: "faded" 0.0;
color: 255 255 255 128;
}
}
part { name: "base-sh";
description { state: "default" 0.0;
rel1.to: "base";
rel1.offset: 0 -1;
rel2.to: "base";
rel2.offset: -1 -2;
image.normal: "inset_round_shadow.png";
}
}
part { name: "base-hi";
description { state: "default" 0.0;
rel1.to: "base";
rel1.offset: 0 1;
rel2.to: "base";
rel2.offset: -1 0;
image.normal: "inset_round_hilight.png";
}
}
part { name: "base";
description { state: "default" 0.0;
rel1.relative: (25/380) (25/380);
rel2.relative: (365/380) (365/380);
aspect: 1.0 1.0; aspect_preference: BOTH;
image.normal: "tacho_base.png";
}
}
part { name: "readout"; type: TEXT; mouse_events: 0;
scale: 1;
effect: SHADOW BOTTOM;
clip_to: "fade_clip";
description { state: "default" 0.0;
visible: 0;
}
}
part { name: "meter_min_sh"; mouse_events: 0;
clip_to: "fade_clip";
description { state: "default" 0.0;
image.normal: "tacho_hand_small_shadow.png";
rel1.to: "meter_sh";
rel2.to: "meter_sh";
map {
on: 1;
rotation.center: "meter_min_sh";
}
}
}
part { name: "meter_min"; mouse_events: 0;
clip_to: "fade_clip";
description { state: "default" 0.0;
image.normal: "tacho_hand_small_min";
color: 51 153 255 255;
rel1.to: "base";
rel2.to: "base";
map {
on: 1;
rotation.center: "base";
}
}
}
part { name: "meter_max_sh"; mouse_events: 0;
clip_to: "fade_clip";
description { state: "default" 0.0;
image.normal: "tacho_hand_small_shadow.png";
rel1.to: "meter_sh";
rel2.to: "meter_sh";
map {
on: 1;
rotation.center: "meter_max_sh";
}
}
}
part { name: "meter_max"; mouse_events: 0;
clip_to: "fade_clip";
description { state: "default" 0.0;
image.normal: "tacho_hand_small_min";
color: 255 153 51 255;
rel1.to: "base";
rel2.to: "base";
map {
on: 1;
rotation.center: "base";
}
}
}
part { name: "meter_sh"; mouse_events: 0;
clip_to: "fade_clip";
description { state: "default" 0.0;
image.normal: "tacho_hand_big_shadow.png";
rel1.to: "meter";
rel1.relative: 0.0 (15/380);
rel1.offset: 0 1;
rel2.to: "meter";
rel2.relative: 1.0 (395/380);
rel2.offset: -1 0;
map {
on: 1;
rotation.center: "meter_sh";
}
}
}
part { name: "meter"; mouse_events: 0;
clip_to: "fade_clip";
description { state: "default" 0.0000;
color: 255 0 0 255;
image.normal: "tacho_hand_big";
rel1.to: "base";
rel2.to: "base";
map {
on: 1;
rotation.center: "base";
}
}
}
part { name: "over"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image.normal: "inset_round_shading.png";
image.normal: "inset_round_shading.png";
}
}
part { name: "knob"; type: SPACER;
description { state: "default" 0.0;
rel1.relative: (140/340) (140/340);
rel1.to: "base";
rel2.relative: (205/340) (205/340);
rel2.to: "base";
min: 4 4;
step: 2 2;
max: 24 24;
}
}
part { name: "knob2";
description { state: "default" 0.0;
rel1.offset: -4 -4;
rel1.to: "knob";
rel2.offset: 3 3;
rel2.to: "knob";
min: 12 12;
max: 32 32;
image.normal: "knob";
}
}
}
programs {
program {
signal: "e,state,enabled"; source: "e";
action: STATE_SET "default" 0.0;
target: "fade_clip";
}
program {
signal: "e,state,disabled"; source: "e";
action: STATE_SET "faded" 0.0;
target: "fade_clip";
}
}
}

View File

@ -1,8 +1,4 @@
group { name: "e/modules/temperature/main";
alias: "e/gadget/thermal/main";
alias: "e/gadget/thermal/main_vert";
alias: "e/modules/thermal/main";
alias: "e/modules/thermal/main_vert";
images.image: "therm_content.png" COMP;
min: 16 16;
max: 128 128;
@ -124,105 +120,3 @@ group { name: "e/modules/temperature/main";
}
}
group { name: "e/gadget/thermal/main";
alias: "e/gadget/thermal/main_vert";
images.image: "therm_content.png" COMP;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_FLOAT) && (id == 1)) {
new Float:val;
val = getfarg(2);
set_drag(PART:"temp_top", 0.0, val);
if (val <= 0.6) set_state(PART:"temp", "default", 0.0);
else if (val <= 0.8) set_state(PART:"temp", "warm", 0.0);
else if (val <= 1.0) set_state(PART:"temp", "hot", 0.0);
}
}
}
parts {
part { name: "base"; type: SPACER;
description { state: "default" 0.0;
aspect: (80 / 160) (80 / 160);
aspect_preference: BOTH;
}
}
part { name: "bg";
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image.normal: "therm_content.png";
color: 32 32 32 255;
}
}
part { name: "temp";
clip_to: "temp_clip";
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image.normal: "therm_content.png";
color: 51 153 255 255;
}
description { state: "warm" 0.0;
inherit: "default" 0.0;
color: 255 153 51 255;
}
description { state: "hot" 0.0;
inherit: "default" 0.0;
color: 255 0 0 255;
}
}
part { name: "fade_clip"; type: RECT;
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
color: 255 255 255 255;
}
description { state: "faded" 0.0;
color: 255 255 255 128;
}
}
part { name: "temp_clip"; type: RECT;
clip_to: "fade_clip";
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
rel1.to_y: "temp_top";
}
}
part { name: "temp_top"; type: SPACER;
dragable.x: 0 0 0;
dragable.y: -1 1 0;
dragable.confine: "temp_limit";
description { state: "default" 0.0;
}
}
part { name: "temp_limit"; type: SPACER;
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
rel1.relative: 0.0 0.1;
rel2.relative: 1.0 0.9;
}
}
part { name: "over"; type: RECT;
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
color: 0 0 0 0;
}
}
}
programs {
program {
signal: "e,state,known"; source: "e";
action: STATE_SET "default" 0.0;
target: "fade_clip";
}
program {
signal: "e,state,unknown"; source: "e";
action: STATE_SET "faded" 0.0;
target: "fade_clip";
}
}
}

View File

@ -0,0 +1,101 @@
group { name: "e/gadget/thermal/main";
alias: "e/gadget/thermal/main_vert";
images.image: "therm_content.png" COMP;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_FLOAT) && (id == 1)) {
new Float:val;
val = getfarg(2);
set_drag(PART:"temp_top", 0.0, val);
if (val <= 0.6) set_state(PART:"temp", "default", 0.0);
else if (val <= 0.8) set_state(PART:"temp", "warm", 0.0);
else if (val <= 1.0) set_state(PART:"temp", "hot", 0.0);
}
}
}
parts {
part { name: "base"; type: SPACER;
description { state: "default" 0.0;
aspect: (80 / 160) (80 / 160);
aspect_preference: BOTH;
}
}
part { name: "bg";
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image.normal: "therm_content.png";
color: 32 32 32 255;
}
}
part { name: "temp";
clip_to: "temp_clip";
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image.normal: "therm_content.png";
color: 51 153 255 255;
}
description { state: "warm" 0.0;
inherit: "default" 0.0;
color: 255 153 51 255;
}
description { state: "hot" 0.0;
inherit: "default" 0.0;
color: 255 0 0 255;
}
}
part { name: "fade_clip"; type: RECT;
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
color: 255 255 255 255;
}
description { state: "faded" 0.0;
color: 255 255 255 128;
}
}
part { name: "temp_clip"; type: RECT;
clip_to: "fade_clip";
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
rel1.to_y: "temp_top";
}
}
part { name: "temp_top"; type: SPACER;
dragable.x: 0 0 0;
dragable.y: -1 1 0;
dragable.confine: "temp_limit";
description { state: "default" 0.0;
}
}
part { name: "temp_limit"; type: SPACER;
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
rel1.relative: 0.0 0.1;
rel2.relative: 1.0 0.9;
}
}
part { name: "over"; type: RECT;
description { state: "default" 0.0;
rel1.to_x: "base";
rel2.to_x: "base";
color: 0 0 0 0;
}
}
}
programs {
program {
signal: "e,state,known"; source: "e";
action: STATE_SET "default" 0.0;
target: "fade_clip";
}
program {
signal: "e,state,unknown"; source: "e";
action: STATE_SET "faded" 0.0;
target: "fade_clip";
}
}
}

View File

@ -1,84 +1,83 @@
group { name: "e/gadget/wireless/ethernet"; nomouse;
images.image: "slot_horiz_top.png" COMP;
images.image: "slot_horiz_bottom.png" COMP;
images.image: "eth.png" COMP;
images.image: "exlclam.png" COMP;
images.image: "hole_tiny.png" COMP;
images.image: "led_tiny_orange.png" COMP;
images.image: "led_tiny_green.png" COMP;
images.image: "lock_locked.png" COMP;
images.image: "lock_insecure.png" COMP;
images.image: "cloud-conn.png" COMP;
images.image: "eth-base.png" COMP;
images.image: "eth-top.png" COMP;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1)) {
new state = getarg(2);
if ((state == 1)) {
set_state(PART:"led", "default", 0.0);
if ((state <= 1)) {
set_state(PART:"eth-base", "default", 0.0);
set_state(PART:"eth", "default", 0.0);
}
else if ((state == 1)) {
set_state(PART:"eth-base", "default", 0.0);
set_state(PART:"eth", "default", 0.0);
run_program(PROGRAM:"connecting");
return;
}
else if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
else { set_state(PART:"led", "default", 0.0); }
if ((state == 2)) {
set_state(PART:"eth-base", "connected", 0.0);
set_state(PART:"eth", "connected", 0.0);
}
else if ((state == 3)) {
set_state(PART:"eth-base", "online", 0.0);
set_state(PART:"eth", "online", 0.0);
}
else {
set_state(PART:"eth-base", "default", 0.0);
set_state(PART:"eth", "default", 0.0);
}
}
}
}
parts {
part { name: "slot_bottom";
description { state: "default" 0.0;
rel1.to: "slot";
rel2.relative: 1.0 0.5;
rel2.to: "slot";
min: 0 3;
image.normal: "slot_horiz_bottom.png";
fixed: 0 1;
}
}
///////////////////////
part { name: "exclam_base";
part { name: "exclam_base";
clip_to: "clip_exclam";
description { state: "default" 0.0;
aspect: (71/144) (71/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "exlclam.png";
min: 11 10;
rel1.relative: (20/160) (50/160);
rel2.relative: (135/160) (150/160);
aspect: (115/105) (115/105); aspect_preference: BOTH;
image.normal: "cloud-conn.png";
}
}
///////////////////////
part { name: "eth_base";
part { name: "eth-base";
clip_to: "clip_eth";
description { state: "default" 0.0;
aspect: (60/144) (60/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "eth.png";
min: 6 13;
aspect: (60/130) (60/130); aspect_preference: BOTH;
rel1.relative: (50/160) (15/160);
rel2.relative: (110/160) (145/160);
image.normal: "eth-base.png";
color: 160 160 160 128;
}
description { state: "connected" 0.0;
inherit: "default" 0.0;
color: 160 160 160 255;
}
description { state: "online" 0.0;
inherit: "default" 0.0;
color: 51 153 255 255;
}
}
part { name: "slot";
part { name: "eth"; mouse_events: 0;
scale: 1;
clip_to: "clip_eth";
description { state: "default" 0.0;
rel1.offset: 0 -1;
rel1.relative: (21/160) 1.0;
rel2.offset: -1 -1;
rel2.relative: (140/160) 1.0;
align: 0.5 1.0;
min: 0 6;
image.normal: "slot_horiz_top.png";
fixed: 0 1;
rel1.to: "eth-base";
rel2.to: "eth-base";
image.normal: "eth-top.png";
color: 160 160 160 128;
}
}
part { name: "hole";
description { state: "default" 0.0;
rel1.offset: -4 -4;
rel1.relative: 1.0 1.0;
rel2.offset: -4 -4;
align: 1.0 1.0;
min: 4 4;
max: 4 4;
image.normal: "hole_tiny.png";
fixed: 1 1;
description { state: "connected" 0.0;
inherit: "default" 0.0;
color: 160 160 160 255;
}
description { state: "online" 0.0;
inherit: "default" 0.0;
color: 160 160 160 255;
}
}
part { name: "clip_exclam"; type: RECT;
@ -97,44 +96,19 @@ group { name: "e/gadget/wireless/ethernet"; nomouse;
visible: 1;
}
}
part { name: "led";
description { state: "default" 0.0;
rel1.to: "hole";
rel2.to: "hole";
min: 10 10;
max: 10 10;
image.normal: "led_tiny_orange.png";
fixed: 1 1;
visible: 0;
}
description { state: "connected" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_orange.png";
visible: 1;
}
description { state: "online" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_green.png";
visible: 1;
}
}
part { name: "event"; type: RECT; mouse;
description { state: "default" 0.0;
color: 0 0 0 0;
}
}
}
programs {
target_group: "eths" "eth-base" "eth";
program { name: "connecting";
action: STATE_SET "connected" 0.0;
target: "led";
groups: "eths";
in: 0.3 0.0;
after: "connecting2";
}
program { name: "connecting2";
action: STATE_SET "default" 0.0;
target: "led";
groups: "eths";
in: 0.3 0.0;
after: "connecting";
}
@ -153,215 +127,98 @@ group { name: "e/gadget/wireless/ethernet"; nomouse;
}
group { name: "e/gadget/wireless/wifi"; nomouse;
images.image: "slot_horiz_top.png" COMP;
images.image: "slot_horiz_bottom.png" COMP;
images.image: "wifi_shadow.png" COMP;
images.image: "wifi_base.png" COMP;
images.image: "wifi_sig_1.png" COMP;
images.image: "wifi_sig_2.png" COMP;
images.image: "wifi_sig_3.png" COMP;
images.image: "exlclam.png" COMP;
images.image: "hole_tiny.png" COMP;
images.image: "led_tiny_orange.png" COMP;
images.image: "led_tiny_green.png" COMP;
images.image: "lock_locked.png" COMP;
images.image: "lock_insecure.png" COMP;
images.image: "cloud-conn.png" COMP;
images.image: "wifi-1.png" COMP;
images.image: "wifi-2.png" COMP;
images.image: "wifi-3.png" COMP;
images.image: "wifi-4.png" COMP;
images.image: "wifi-5.png" COMP;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1)) {
new state = getarg(2), signl = getarg(3);
if (state <= 1) {
set_state(PART:"wifi_1", "default", 0.0);
set_state(PART:"wifi_2", "default", 0.0);
set_state(PART:"wifi_3", "default", 0.0);
set_state(PART:"led", "default", 0.0);
set_state(PART:"wifi-base", "default", 0.0);
set_state(PART:"wifi", "default", 0.0);
}
if (state == 1) {
run_program(PROGRAM:"connecting");
run_program(PROGRAM:"connecting_wifi");
return;
}
stop_programs_on(PART:"led");
if (signl <= 14) {
set_state(PART:"wifi_1", "default", 0.0);
set_state(PART:"wifi_2", "default", 0.0);
set_state(PART:"wifi_3", "default", 0.0);
set_state(PART:"wifi", "default", float(signl) / 100.0);
if ((state == 2)) {
set_state(PART:"wifi-base", "connected", 0.0);
}
else if (signl <= 28) {
set_state(PART:"wifi_1", "partly", 0.0);
set_state(PART:"wifi_2", "default", 0.0);
set_state(PART:"wifi_3", "default", 0.0);
}
else if (signl <= 42) {
set_state(PART:"wifi_1", "visible", 0.0);
set_state(PART:"wifi_2", "default", 0.0);
set_state(PART:"wifi_3", "default", 0.0);
}
else if (signl <= 57) {
set_state(PART:"wifi_1", "visible", 0.0);
set_state(PART:"wifi_2", "partly", 0.0);
set_state(PART:"wifi_3", "default", 0.0);
}
else if (signl <= 71) {
set_state(PART:"wifi_1", "visible", 0.0);
set_state(PART:"wifi_2", "visible", 0.0);
set_state(PART:"wifi_3", "default", 0.0);
}
else if (signl <= 85) {
set_state(PART:"wifi_1", "visible", 0.0);
set_state(PART:"wifi_2", "visible", 0.0);
set_state(PART:"wifi_3", "partly", 0.0);
else if ((state == 3)) {
set_state(PART:"wifi-base", "online", 0.0);
}
else {
set_state(PART:"wifi_1", "visible", 0.0);
set_state(PART:"wifi_2", "visible", 0.0);
set_state(PART:"wifi_3", "visible", 0.0);
set_state(PART:"wifi-base", "default", 0.0);
}
if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
else { set_state(PART:"led", "default", 0.0); }
}
}
}
parts {
part { name: "slot_bottom";
description { state: "default" 0.0;
rel1.to: "slot";
rel2.relative: 1.0 0.5;
rel2.to: "slot";
min: 0 3;
image.normal: "slot_horiz_bottom.png";
fixed: 0 1;
}
}
///////////////////////
part { name: "exclam_base";
clip_to: "clip_exclam";
description { state: "default" 0.0;
aspect: (71/144) (71/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "exlclam.png";
min: 11 10;
rel1.relative: (20/160) (50/160);
rel2.relative: (135/160) (150/160);
aspect: (115/105) (115/105); aspect_preference: BOTH;
image.normal: "cloud-conn.png";
}
}
///////////////////////
part { name: "wifi_shadow";
part { name: "wifi-base";
clip_to: "clip_wifi";
description { state: "default" 0.0;
aspect: (160/144) (160/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "wifi_shadow.png";
min: 14 10;
aspect: (140/100) (140/100); aspect_preference: BOTH;
rel1.relative: (10/160) (30/160);
rel2.relative: (150/160) (130/160);
image.normal: "wifi-1.png";
color: 160 160 160 255;
}
description { state: "connected" 0.0;
inherit: "default" 0.0;
color: 160 160 160 255;
}
description { state: "online" 0.0;
inherit: "default" 0.0;
color: 51 153 255 255;
}
}
part { name: "wifi_base";
part { name: "wifi"; mouse_events: 0;
clip_to: "clip_wifi";
description { state: "default" 0.0;
aspect: (160/144) (160/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "wifi_base.png";
rel1.to: "wifi-base";
rel2.to: "wifi-base";
image.normal: "wifi-1.png";
color: 0 0 0 0;
}
}
part { name: "wifi_1";
clip_to: "clip_wifi";
description { state: "default" 0.0;
rel1.to: "wifi_base";
rel2.to: "wifi_base";
image.normal: "wifi_sig_1.png";
visible: 0;
}
description { state: "partly" 0.0;
description { state: "default" 0.25;
inherit: "default" 0.0;
color: 255 255 255 128;
visible: 1;
image.normal: "wifi-2.png";
color: 160 160 160 255;
}
description { state: "visible" 0.0;
description { state: "default" 0.5;
inherit: "default" 0.0;
visible: 1;
image.normal: "wifi-3.png";
color: 160 160 160 255;
}
}
part { name: "wifi_2";
clip_to: "clip_wifi";
description { state: "default" 0.0;
rel1.to: "wifi_base";
rel2.to: "wifi_base";
image.normal: "wifi_sig_2.png";
visible: 0;
}
description { state: "partly" 0.0;
description { state: "default" 0.75;
inherit: "default" 0.0;
color: 255 255 255 128;
visible: 1;
image.normal: "wifi-4.png";
color: 160 160 160 255;
}
description { state: "visible" 0.0;
description { state: "default" 1.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "wifi_3";
clip_to: "clip_wifi";
description { state: "default" 0.0;
rel1.to: "wifi_base";
rel2.to: "wifi_base";
image.normal: "wifi_sig_3.png";
visible: 0;
}
description { state: "partly" 0.0;
inherit: "default" 0.0;
color: 255 255 255 128;
visible: 1;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "lock";
clip_to: "clip_wifi";
description { state: "default" 0.0; hid;
aspect: (160/144) (160/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "lock_locked.png";
link.base: "e,state,unsecured" "e";
}
desc { "insecure"; inherit; vis;
image.normal: "lock_insecure.png";
link.base: "e,state,insecure" "e";
}
desc { "secure"; inherit; vis;
link.base: "e,state,secure" "e";
}
}
//////////////////////////
part { name: "slot";
description { state: "default" 0.0;
rel1.offset: 0 -1;
rel1.relative: (21/160) 1.0;
rel2.offset: -1 -1;
rel2.relative: (140/160) 1.0;
align: 0.5 1.0;
min: 0 6;
image.normal: "slot_horiz_top.png";
fixed: 0 1;
}
}
part { name: "hole";
description { state: "default" 0.0;
rel1.offset: -4 -4;
rel1.relative: 1.0 1.0;
rel2.offset: -4 -4;
align: 1.0 1.0;
min: 4 4;
max: 4 4;
image.normal: "hole_tiny.png";
fixed: 1 1;
image.normal: "wifi-5.png";
color: 160 160 160 255;
}
}
part { name: "clip_exclam"; type: RECT;
@ -380,27 +237,6 @@ group { name: "e/gadget/wireless/wifi"; nomouse;
visible: 1;
}
}
part { name: "led";
description { state: "default" 0.0;
rel1.to: "hole";
rel2.to: "hole";
min: 10 10;
max: 10 10;
image.normal: "led_tiny_orange.png";
fixed: 1 1;
visible: 0;
}
description { state: "connected" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_orange.png";
visible: 1;
}
description { state: "online" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_green.png";
visible: 1;
}
}
part { name: "event"; type: RECT; mouse;
description { state: "default" 0.0;
color: 0 0 0 0;
@ -409,37 +245,32 @@ group { name: "e/gadget/wireless/wifi"; nomouse;
}
programs {
program { "connecting_wifi";
action: STATE_SET "default";
targets: "wifi_1" "wifi_2" "wifi_3";
sequence {
action: STATE_SET "partly";
target: "wifi_1";
action: STATE_SET "default" 0.0;
target: "wifi";
transition: LINEAR 0.085;
action: STATE_SET "visible";
target: "wifi_1";
action: STATE_SET "default" 0.25;
target: "wifi";
transition: LINEAR 0.085;
action: STATE_SET "partly";
target: "wifi_2";
action: STATE_SET "default" 0.50;
target: "wifi";
transition: LINEAR 0.085;
action: STATE_SET "visible";
target: "wifi_2";
action: STATE_SET "default" 0.75;
target: "wifi";
transition: LINEAR 0.085;
action: STATE_SET "partly";
target: "wifi_3";
transition: LINEAR 0.085;
action: STATE_SET "visible";
target: "wifi_3";
action: STATE_SET "default" 1.0;
target: "wifi";
transition: LINEAR 0.085;
after: "connecting_wifi";
}
}
program { "connecting";
action: STATE_SET "connected";
target: "led";
action: STATE_SET "connected" 0.0;
target: "wifi-base";
in: 0.3 0.0;
sequence {
action: STATE_SET "default";
target: "led";
action: STATE_SET "default" 0.0;
target: "wifi-base";
in: 0.3 0.0;
after: "connecting";
}
@ -459,19 +290,14 @@ group { name: "e/gadget/wireless/wifi"; nomouse;
}
group { name: "e/gadget/wireless/bluetooth"; nomouse;
images.image: "slot_horiz_top.png" COMP;
images.image: "slot_horiz_bottom.png" COMP;
images.image: "exlclam.png" COMP;
images.image: "hole_tiny.png" COMP;
images.image: "led_tiny_orange.png" COMP;
images.image: "led_tiny_green.png" COMP;
images.image: "cloud-conn.png" COMP;
images.image: "bt_base.png" COMP;
images.image: "bt_sig_1.png" COMP;
images.image: "bt_sig_2.png" COMP;
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1)) {
new state = getarg(2), signl = getarg(3);
new signl = getarg(3);
if (signl <= 20) {
set_state(PART:"bt_1", "default", 0.0);
set_state(PART:"bt_2", "default", 0.0);
@ -492,38 +318,19 @@ group { name: "e/gadget/wireless/bluetooth"; nomouse;
set_state(PART:"bt_1", "visible", 0.0);
set_state(PART:"bt_2", "visible", 0.0);
}
if ((state == 2)) {
set_state(PART:"led", "default", 0.0);
run_program(PROGRAM:"connecting");
return;
}
else if ((state == 3)) { return; }
else if ((state == 4)) { set_state(PART:"led", "connected", 0.0); }
else if ((state == 5)) { set_state(PART:"led", "online", 0.0); }
else { set_state(PART:"led", "default", 0.0); }
}
}
}
parts {
part { name: "slot_bottom";
description { state: "default" 0.0;
rel1.to: "slot";
rel2.relative: 1.0 0.5;
rel2.to: "slot";
min: 0 3;
image.normal: "slot_horiz_bottom.png";
fixed: 0 1;
}
}
///////////////////////
///////////////////////
part { name: "exclam_base";
clip_to: "clip_exclam";
description { state: "default" 0.0;
aspect: (71/144) (71/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "exlclam.png";
min: 11 10;
rel1.relative: (20/160) (50/160);
rel2.relative: (135/160) (150/160);
aspect: (115/105) (115/105); aspect_preference: BOTH;
image.normal: "cloud-conn.png";
}
}
///////////////////////
@ -531,9 +338,6 @@ group { name: "e/gadget/wireless/bluetooth"; nomouse;
clip_to: "clip_bt";
description { state: "default" 0.0;
aspect: (160/144) (160/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "bt_base.png";
}
}
@ -574,36 +378,13 @@ group { name: "e/gadget/wireless/bluetooth"; nomouse;
}
}
///////////////////////
part { name: "slot";
description { state: "default" 0.0;
rel1.offset: 0 -1;
rel1.relative: (21/160) 1.0;
rel2.offset: -1 -1;
rel2.relative: (140/160) 1.0;
align: 0.5 1.0;
min: 0 6;
image.normal: "slot_horiz_top.png";
fixed: 0 1;
}
}
part { name: "hole";
description { state: "default" 0.0;
rel1.offset: -4 -4;
rel1.relative: 1.0 1.0;
rel2.offset: -4 -4;
align: 1.0 1.0;
min: 4 4;
max: 4 4;
image.normal: "hole_tiny.png";
fixed: 1 1;
}
}
part { name: "clip_exclam"; type: RECT;
description { state: "default" 0.0;
visible: 1;
}
description { state: "bt" 0.0;
visible: 0;
visible: 0;
}
}
part { name: "clip_bt"; type: RECT;
@ -614,27 +395,6 @@ group { name: "e/gadget/wireless/bluetooth"; nomouse;
visible: 1;
}
}
part { name: "led";
description { state: "default" 0.0;
rel1.to: "hole";
rel2.to: "hole";
min: 10 10;
max: 10 10;
image.normal: "led_tiny_orange.png";
fixed: 1 1;
visible: 0;
}
description { state: "connected" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_orange.png";
visible: 1;
}
description { state: "online" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_green.png";
visible: 1;
}
}
part { name: "event"; type: RECT; mouse;
description { state: "default" 0.0;
color: 0 0 0 0;
@ -642,18 +402,6 @@ group { name: "e/gadget/wireless/bluetooth"; nomouse;
}
}
programs {
program { name: "connecting";
action: STATE_SET "connected" 0.0;
target: "led";
in: 0.3 0.0;
after: "connecting2";
}
program { name: "connecting2";
action: STATE_SET "default" 0.0;
target: "led";
in: 0.3 0.0;
after: "connecting";
}
program {
signal: "e,state,error"; source: "e";
action: STATE_SET "default" 0.0;
@ -670,12 +418,7 @@ group { name: "e/gadget/wireless/bluetooth"; nomouse;
}
group { name: "e/gadget/wireless/cellular";
images.image: "slot_horiz_top.png" COMP;
images.image: "slot_horiz_bottom.png" COMP;
images.image: "exlclam.png" COMP;
images.image: "hole_tiny.png" COMP;
images.image: "led_tiny_orange.png" COMP;
images.image: "led_tiny_green.png" COMP;
images.image: "cloud-conn.png" COMP;
images.image: "cell_base.png" COMP;
images.image: "cell_sig_1.png" COMP;
images.image: "cell_sig_2.png" COMP;
@ -685,7 +428,7 @@ group { name: "e/gadget/wireless/cellular";
script {
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1)) {
new state = getarg(2), signl = getarg(3);
new signl = getarg(3);
if (signl <= 11) {
set_state(PART:"cell_1", "default", 0.0);
set_state(PART:"cell_2", "default", 0.0);
@ -740,37 +483,19 @@ group { name: "e/gadget/wireless/cellular";
set_state(PART:"cell_3", "visible", 0.0);
set_state(PART:"cell_4", "visible", 0.0);
}
if ((state == 1)) {
set_state(PART:"led", "default", 0.0);
run_program(PROGRAM:"connecting");
return;
}
else if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
else { set_state(PART:"led", "default", 0.0); }
}
}
}
parts {
part { name: "slot_bottom"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "slot";
rel2.relative: 1.0 0.5;
rel2.to: "slot";
min: 0 3;
image.normal: "slot_horiz_bottom.png";
fixed: 0 1;
}
}
///////////////////////
part { name: "exclam_base"; mouse_events: 0;
part { name: "exclam_base";
clip_to: "clip_exclam";
description { state: "default" 0.0;
aspect: (71/144) (71/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "exlclam.png";
min: 11 10;
rel1.relative: (20/160) (50/160);
rel2.relative: (135/160) (150/160);
aspect: (115/105) (115/105); aspect_preference: BOTH;
image.normal: "cloud-conn.png";
}
}
///////////////////////
@ -778,9 +503,6 @@ group { name: "e/gadget/wireless/cellular";
clip_to: "clip_cell";
description { state: "default" 0.0;
aspect: (160/144) (160/144); aspect_preference: BOTH;
align: 0.5 1.0;
rel2.relative: 1.0 0.5;
rel2.to_y: "slot";
image.normal: "cell_base.png";
}
}
@ -812,7 +534,7 @@ group { name: "e/gadget/wireless/cellular";
}
description { state: "partly" 0.0;
inherit: "default" 0.0;
color: 255 255 255 128;
color: 255 255 255 128;
visible: 1;
}
description { state: "visible" 0.0;
@ -857,30 +579,6 @@ group { name: "e/gadget/wireless/cellular";
}
}
///////////////////////
part { name: "slot"; mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: 0 -1;
rel1.relative: (21/160) 1.0;
rel2.offset: -1 -1;
rel2.relative: (140/160) 1.0;
align: 0.5 1.0;
min: 0 6;
image.normal: "slot_horiz_top.png";
fixed: 0 1;
}
}
part { name: "hole"; mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: -4 -4;
rel1.relative: 1.0 1.0;
rel2.offset: -4 -4;
align: 1.0 1.0;
min: 4 4;
max: 4 4;
image.normal: "hole_tiny.png";
fixed: 1 1;
}
}
part { name: "clip_exclam"; type: RECT;
description { state: "default" 0.0;
visible: 1;
@ -897,47 +595,13 @@ group { name: "e/gadget/wireless/cellular";
visible: 1;
}
}
part { name: "led"; mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "hole";
rel2.to: "hole";
min: 10 10;
max: 10 10;
image.normal: "led_tiny_orange.png";
fixed: 1 1;
visible: 0;
}
description { state: "connected" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_orange.png";
visible: 1;
}
description { state: "online" 0.0;
inherit: "default" 0.0;
image.normal: "led_tiny_green.png";
visible: 1;
}
}
part { name: "event"; type: RECT;
description { state: "default" 0.0;
color: 0 0 0 0;
}
}
}
programs {
program { name: "connecting";
action: STATE_SET "connected" 0.0;
target: "led";
in: 0.3 0.0;
after: "connecting2";
}
program { name: "connecting2";
action: STATE_SET "default" 0.0;
target: "led";
in: 0.3 0.0;
after: "connecting";
}
program {
signal: "e,state,error"; source: "e";
action: STATE_SET "default" 0.0;