summaryrefslogtreecommitdiff
path: root/data/elementary/themes/edc/batman.edc
blob: 001beb3d5403ab2353d25fc982b1af56faacb713 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
group { name: "e/gadget/batman/main";
   alias: "e/gadget/batman/main_vert";
   images.image: "bat_base.png" COMP;
   script {
      public message(Msg_Type:type, id, ...) {
         if ((type == MSG_FLOAT) && (id == 1)) {
            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: "pulse_clip"; type: RECT;
         description { state: "default" 0.0;
            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: "fill_clip"; type: RECT;
         clip_to: "fill_clip_dim";
         description { state: "default" 0.0;
            rel1.to: "bg";
            rel2.to: "bg";
         }
      }
      part { name: "bg";
         clip_to: "pulse_clip";
         description { state: "default" 0.0;
            aspect: 1.0 1.0; aspect_preference: BOTH;
            image.normal: "bat_base.png";
            color: 0 0 0 64;
         }
      }
      part { name: "fill";
         clip_to: "fill_clip";
         description { state: "default" 0.0;
            rel1.to: "bg";
            rel2.to: "bg";
            image.normal: "bat_base.png";
            color: 160 160 160 255;
         }
         description { state: "charging" 0.0;
            inherit: "default" 0.0;
            color: 51 153 255 255;
         }
      }
      part { name: "over"; type: RECT;
         description { state: "default" 0.0;
            color: 0 0 0 0;
         }
      }
   }
   programs {
      program {
         signal: "e,state,charging"; source: "e";
         action: STATE_SET "charging" 0.0;
         target: "fill";
      }
      program {
         signal: "e,state,discharging"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "fill";
      }
      program { name: "pulse";
         signal: "e,action,pulse,start"; source: "e";
         action: STATE_SET "faded" 0.0;
         transition: ACCELERATE 0.3;
         after: "pulse2";
         target: "pulse_clip";
      }
      program { name: "pulse2";
         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: 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: 240 160;
            align: 0.0 0.5;
         }
      }
      part { name: "e.text.title"; type: TEXT;
         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: 160 160 160 255;
            text { font: "Sans:style=Bold"; size: 10;
               text: "Your battery is low!";
               min: 1 1;
               ellipsis: -1;
               text_class: "module_large";
            }
         }
      }
      part { name: "e.text.label"; type: TEXT;
         scale: 1;
         description { state: "default" 0.0;
            rel1.relative: 1.0 0.5;
            rel1.to_x: "e.swallow.batman";
            color: 160 160 160 255;
            text { font: "Sans"; size: 10;
               text: "AC power is recommended.";
               min: 1 1;
               ellipsis: -1;
               text_class: "module_normal";
            }
         }
      }
   }
}