summaryrefslogtreecommitdiff
path: root/data/elementary/themes/edc/thermal.edc
blob: bea2d57d5f3b78954e347229ea59402b36f30f47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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";
      }
   }
}