1group { name: "e/modules/temperature/main";
2   images.image: "therm_content.png" COMP;
3   images.image: "therm_shadow.png" COMP;
4   images.image: "therm_shine.png" COMP;
5   script {
6    public message(Msg_Type:type, id, ...) {
7       if ((type == MSG_FLOAT) && (id == 1)) {
8          new Float:val;
9          val = getfarg(2);
10          set_drag(PART:"temp_top", 0.0, val);
11       }
12    }
13   }
14   parts {
15      part { name: "shadow";
16         description { state: "default" 0.0;
17            aspect: 0.5 0.5; aspect_preference: BOTH;
18            align: 0.5 0.5;
19            max: 80 160;
20            image.normal: "therm_shadow.png";
21         }
22      }
23      part { name: "temp";
24         clip_to: "temp_clip";
25         description { state: "default" 0.0;
26            rel1.to: "shadow";
27            rel2.to: "shadow";
28            image.normal: "therm_content.png";
29         }
30      }
31      part { name: "overlay";
32         description { state: "default" 0.0;
33            rel1.to: "shadow";
34            rel2.to: "shadow";
35            image.normal: "therm_shine.png";
36         }
37      }
38      part { name: "e.text.reading"; type: TEXT;
39         scale: 1;
40         effect: SHADOW BOTTOM;
41         clip_to: "fade_clip";
42         description { state: "default" 0.0;
43            color_class: "module_label_invisible";
44            color3: 255 255 255 255;
45            text { font: FN; size: 9;
46               fit: 1 1;
47               ellipsis: -1;
48               text_class: "module_small";
49            }
50         }
51         description { state: "visible" 0.0;
52            inherit: "default" 0.0;
53            color_class: "module_label";
54            color3: 255 255 255 255;
55         }
56      }
57      part { name: "fade_clip"; type: RECT;
58         description { state: "default" 0.0;
59            color: 255 255 255 255;
60         }
61         description { state: "faded" 0.0;
62            color: 255 255 255 128;
63         }
64      }
65      part { name: "temp_clip"; type: RECT;
66         clip_to: "fade_clip";
67         description { state: "default" 0.0;
68            rel1.to_y: "temp_top";
69         }
70      }
71      part { name: "temp_top"; type: SPACER;
72         dragable.x: 0 0 0;
73         dragable.y: -1 1 0;
74         dragable.confine: "temp_limit";
75         description { state: "default" 0.0;
76         }
77      }
78      part { name: "temp_limit"; type: SPACER;
79         description { state: "default" 0.0;
80            rel1.relative: 0.0 0.1;
81            rel2.relative: 1.0 0.9;
82         }
83      }
84      part { name: "over"; type: RECT;
85         description { state: "default" 0.0;
86            color: 0 0 0 0;
87         }
88      }
89   }
90   programs {
91      program {
92         signal: "mouse,in"; source: "over";
93         action: STATE_SET "visible" 0.0;
94         transition: LINEAR 0.3;
95         target: "e.text.reading";
96      }
97      program {
98         signal: "mouse,out"; source: "over";
99         action: STATE_SET "default" 0.0;
100         transition: LINEAR 1.0;
101         target: "e.text.reading";
102      }
103      program {
104         signal: "e,state,known"; source: "e";
105         action: STATE_SET "default" 0.0;
106         target: "fade_clip";
107      }
108      program {
109         signal: "e,state,unknown"; source: "e";
110         action: STATE_SET "faded" 0.0;
111         target: "fade_clip";
112      }
113   }
114}
115
116group { name: "e/gadget/thermal/main";
117   alias: "e/gadget/thermal/main_vert";
118   images.image: "therm_content.png" COMP;
119   images.image: "therm_shadow.png" COMP;
120   script {
121    public message(Msg_Type:type, id, ...) {
122       if ((type == MSG_FLOAT) && (id == 1)) {
123          new Float:val;
124          val = getfarg(2);
125          set_drag(PART:"temp_top", 0.0, val);
126       }
127    }
128   }
129   parts {
130      part { name: "base"; type: SPACER;
131         description { state: "default" 0.0;
132            aspect: (80 / 160) (80 / 160);
133            aspect_preference: BOTH;
134         }
135      }
136      part { name: "shadow";
137         description { state: "default" 0.0;
138            rel1.to: "base";
139            rel2.to: "base";
140            image.normal: "therm_shadow.png";
141         }
142      }
143       part { name: "temp";
144         clip_to: "temp_clip";
145         description { state: "default" 0.0;
146            rel1.to: "base";
147            rel2.to: "base";
148            image.normal: "therm_content.png";
149         }
150      }
151      part { name: "fade_clip"; type: RECT;
152         description { state: "default" 0.0;
153            rel1.to_x: "base";
154            rel2.to_x: "base";
155            color: 255 255 255 255;
156         }
157         description { state: "faded" 0.0;
158            color: 255 255 255 128;
159         }
160      }
161      part { name: "temp_clip"; type: RECT;
162         clip_to: "fade_clip";
163         description { state: "default" 0.0;
164            rel1.to_x: "base";
165            rel2.to_x: "base";
166            rel1.to_y: "temp_top";
167         }
168      }
169      part { name: "temp_top"; type: SPACER;
170         dragable.x: 0 0 0;
171         dragable.y: -1 1 0;
172         dragable.confine: "temp_limit";
173         description { state: "default" 0.0;
174         }
175      }
176      part { name: "temp_limit"; type: SPACER;
177         description { state: "default" 0.0;
178            rel1.to_x: "base";
179            rel2.to_x: "base";
180            rel1.relative: 0.0 0.1;
181            rel2.relative: 1.0 0.9;
182         }
183      }
184      part { name: "over"; type: RECT;
185         description { state: "default" 0.0;
186            rel1.to_x: "base";
187            rel2.to_x: "base";
188            color: 0 0 0 0;
189         }
190      }
191   }
192   programs {
193      program {
194         signal: "e,state,known"; source: "e";
195         action: STATE_SET "default" 0.0;
196         target: "fade_clip";
197      }
198      program {
199         signal: "e,state,unknown"; source: "e";
200         action: STATE_SET "faded" 0.0;
201         target: "fade_clip";
202      }
203   }
204}
205
206