summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-01-13 22:49:57 +0000
committerAndy Williams <andy@andywilliams.me>2017-01-13 22:51:01 +0000
commit051013f4e10b1add8646605e9857e5c8636f32c6 (patch)
treeeeada0e4026ea13f5dfba1d1dd3cadba9b745137 /data
parentde1a6d6f4294ccb25d73d96f765420cc6cb3fff6 (diff)
Luncher: Fix engage theme to scale more smoothly.
There is still a layering issue and the algorithm could be improved
Diffstat (limited to 'data')
-rw-r--r--data/elementary/themes/edc/luncher.edc178
1 files changed, 42 insertions, 136 deletions
diff --git a/data/elementary/themes/edc/luncher.edc b/data/elementary/themes/edc/luncher.edc
index f36f7c8..2c3f915 100644
--- a/data/elementary/themes/edc/luncher.edc
+++ b/data/elementary/themes/edc/luncher.edc
@@ -43,6 +43,13 @@ group { name: "e/gadget/luncher/icon";
43 script { 43 script {
44 public urgent; 44 public urgent;
45 public style; 45 public style;
46 public Float:engage_scale(cursorpos, iconpos, size) {
47 new Float:scale = 2.25 - (abs(cursorpos-(iconpos+size/2)) / (size*2));
48 if (scale < 1.0) scale = 1.0;
49 if (scale > 2.0) scale = 2.0;
50
51 return scale;
52 }
46 public message(Msg_Type:type, id, ...) { 53 public message(Msg_Type:type, id, ...) {
47 54
48//Style Variable - Used to Identify Style - Name Must Match an Item in the Data List of e/gadget/luncher/bar 55//Style Variable - Used to Identify Style - Name Must Match an Item in the Data List of e/gadget/luncher/bar
@@ -84,145 +91,44 @@ group { name: "e/gadget/luncher/icon";
84 } 91 }
85 } 92 }
86 else if (!strcmp(s, "engage")) { 93 else if (!strcmp(s, "engage")) {
87 if (pos == 0) { 94 if (pos == 0 && (xpos >= x) && (xpos <= (x+w))) {
88 if ((ypos >= y) && (ypos <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) { 95 new Float:scale = engage_scale(ypos, y, h);
89 custom_state(PART:"sizer", "default", 0.0); 96 new Float:halfscale = scale/2;
90 set_state_val(PART:"sizer", STATE_REL1, 0.0, -0.5); 97
91 set_state_val(PART:"sizer", STATE_REL2, 2.0, 1.5); 98 custom_state(PART:"sizer", "default", 0.0);
92 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0); 99 set_state_val(PART:"sizer", STATE_REL1, 0.0, 0.5-halfscale);
93 } 100 set_state_val(PART:"sizer", STATE_REL2, scale, 0.5+halfscale);
94 else if (((ypos-h) >= y) && ((ypos-h) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) { 101 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
95 custom_state(PART:"sizer", "default", 0.0); 102 }
96 set_state_val(PART:"sizer", STATE_REL1, 0.0, -0.3); 103 else if (pos == 1 && (ypos >= y) && (ypos <= (y+h))) {
97 set_state_val(PART:"sizer", STATE_REL2, 1.6, 1.3); 104 new Float:scale = engage_scale(xpos, x, w);
98 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0); 105 new Float:halfscale = scale/2;
99 } 106
100 else if (((ypos+h) >= y) && ((ypos+h) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) { 107 custom_state(PART:"sizer", "default", 0.0);
101 custom_state(PART:"sizer", "default", 0.0); 108 set_state_val(PART:"sizer", STATE_REL1, 0.5-halfscale, 0.0);
102 set_state_val(PART:"sizer", STATE_REL1, 0.0, -0.3); 109 set_state_val(PART:"sizer", STATE_REL2, 0.5+halfscale, scale);
103 set_state_val(PART:"sizer", STATE_REL2, 1.6, 1.3); 110 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
104 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
105 }
106 else if (((ypos-(h*2)) >= y) && ((ypos-(h*2)) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) {
107 custom_state(PART:"sizer", "default", 0.0);
108 set_state_val(PART:"sizer", STATE_REL1, 0.0, -0.2);
109 set_state_val(PART:"sizer", STATE_REL2, 1.4, 1.2);
110 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
111 }
112 else if (((ypos+(h*2)) >= y) && ((ypos+(h*2)) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) {
113 custom_state(PART:"sizer", "default", 0.0);
114 set_state_val(PART:"sizer", STATE_REL1, 0.0, -0.2);
115 set_state_val(PART:"sizer", STATE_REL2, 1.4, 1.2);
116 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
117 }
118 else {
119 set_state_anim(PART:"sizer", "default", 0.0, LINEAR, 1.0);
120 }
121 } 111 }
122 else if (pos == 1) { 112 else if (pos == 2 && (xpos >= x) && (xpos <= (x+w))) {
123 if ((xpos >= x) && (xpos <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) { 113 new Float:scale = engage_scale(ypos, y, h);
124 custom_state(PART:"sizer", "default", 0.0); 114 new Float:halfscale = scale/2;
125 set_state_val(PART:"sizer", STATE_REL1, -0.5, 0.0); 115
126 set_state_val(PART:"sizer", STATE_REL2, 1.5, 2.0); 116 custom_state(PART:"sizer", "default", 0.0);
127 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0); 117 set_state_val(PART:"sizer", STATE_REL1, 1.0-scale, 0.5-halfscale);
128 } 118 set_state_val(PART:"sizer", STATE_REL2, 1.0, 0.5+halfscale);
129 else if (((xpos-w) >= x) && ((xpos-w) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) { 119 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
130 custom_state(PART:"sizer", "default", 0.0);
131 set_state_val(PART:"sizer", STATE_REL1, -0.3, 0.0);
132 set_state_val(PART:"sizer", STATE_REL2, 1.3, 1.6);
133 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
134 }
135 else if (((xpos+w) >= x) && ((xpos+w) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) {
136 custom_state(PART:"sizer", "default", 0.0);
137 set_state_val(PART:"sizer", STATE_REL1, -0.3, 0.0);
138 set_state_val(PART:"sizer", STATE_REL2, 1.3, 1.6);
139 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
140 }
141 else if (((xpos-(w*2)) >= x) && ((xpos-(w*2)) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) {
142 custom_state(PART:"sizer", "default", 0.0);
143 set_state_val(PART:"sizer", STATE_REL1, -0.2, 0.0);
144 set_state_val(PART:"sizer", STATE_REL2, 1.2, 1.4);
145 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
146 }
147 else if (((xpos+(w*2)) >= x) && ((xpos+(w*2)) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) {
148 custom_state(PART:"sizer", "default", 0.0);
149 set_state_val(PART:"sizer", STATE_REL1, -0.2, 0.0);
150 set_state_val(PART:"sizer", STATE_REL2, 1.2, 1.4);
151 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
152 }
153 else {
154 set_state_anim(PART:"sizer", "default", 0.0, LINEAR, 1.0);
155 }
156 } 120 }
157 else if (pos == 2) { 121 else if (pos == 3 && (ypos >= y) && (ypos <= (y+h))) {
158 if ((ypos >= y) && (ypos <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) { 122 new Float:scale = engage_scale(xpos, x, w);
159 custom_state(PART:"sizer", "default", 0.0); 123 new Float:halfscale = scale/2;
160 set_state_val(PART:"sizer", STATE_REL1, -1.0, -0.5); 124
161 set_state_val(PART:"sizer", STATE_REL2, 1.0, 1.5); 125 custom_state(PART:"sizer", "default", 0.0);
162 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0); 126 set_state_val(PART:"sizer", STATE_REL1, 0.5-halfscale, 1.0-scale);
163 } 127 set_state_val(PART:"sizer", STATE_REL2, 0.5+halfscale, 1.0);
164 else if (((ypos-h) >= y) && ((ypos-h) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) { 128 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
165 custom_state(PART:"sizer", "default", 0.0);
166 set_state_val(PART:"sizer", STATE_REL1, -0.6, -0.3);
167 set_state_val(PART:"sizer", STATE_REL2, 1.0, 1.3);
168 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
169 }
170 else if (((ypos+h) >= y) && ((ypos+h) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) {
171 custom_state(PART:"sizer", "default", 0.0);
172 set_state_val(PART:"sizer", STATE_REL1, -0.6, -0.3);
173 set_state_val(PART:"sizer", STATE_REL2, 1.0, 1.3);
174 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
175 }
176 else if (((ypos-(h*2)) >= y) && ((ypos-(h*2)) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) {
177 custom_state(PART:"sizer", "default", 0.0);
178 set_state_val(PART:"sizer", STATE_REL1, -0.4, -0.2);
179 set_state_val(PART:"sizer", STATE_REL2, 1.0, 1.2);
180 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
181 }
182 else if (((ypos+(h*2)) >= y) && ((ypos+(h*2)) <= (y+h)) && (xpos >= x) && (xpos <= (x+w))) {
183 custom_state(PART:"sizer", "default", 0.0);
184 set_state_val(PART:"sizer", STATE_REL1, -0.4, -0.2);
185 set_state_val(PART:"sizer", STATE_REL2, 1.0, 1.2);
186 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
187 }
188 else {
189 set_state_anim(PART:"sizer", "default", 0.0, LINEAR, 1.0);
190 }
191 } 129 }
192 else if (pos == 3) { 130 else {
193 if ((xpos >= x) && (xpos <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) { 131 set_state_anim(PART:"sizer", "default", 0.0, LINEAR, 1.0);
194 custom_state(PART:"sizer", "default", 0.0);
195 set_state_val(PART:"sizer", STATE_REL1, -0.5, -1.0);
196 set_state_val(PART:"sizer", STATE_REL2, 1.5, 1.0);
197 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
198 }
199 else if (((xpos-w) >= x) && ((xpos-w) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) {
200 custom_state(PART:"sizer", "default", 0.0);
201 set_state_val(PART:"sizer", STATE_REL1, -0.3, -0.6);
202 set_state_val(PART:"sizer", STATE_REL2, 1.3, 1.0);
203 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
204 }
205 else if (((xpos+w) >= x) && ((xpos+w) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) {
206 custom_state(PART:"sizer", "default", 0.0);
207 set_state_val(PART:"sizer", STATE_REL1, -0.3, -0.6);
208 set_state_val(PART:"sizer", STATE_REL2, 1.3, 1.0);
209 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
210 }
211 else if (((xpos-(w*2)) >= x) && ((xpos-(w*2)) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) {
212 custom_state(PART:"sizer", "default", 0.0);
213 set_state_val(PART:"sizer", STATE_REL1, -0.2, -0.4);
214 set_state_val(PART:"sizer", STATE_REL2, 1.2, 1.0);
215 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
216 }
217 else if (((xpos+(w*2)) >= x) && ((xpos+(w*2)) <= (x+w)) && (ypos >= y) && (ypos <= (y+h))) {
218 custom_state(PART:"sizer", "default", 0.0);
219 set_state_val(PART:"sizer", STATE_REL1, -0.2, -0.4);
220 set_state_val(PART:"sizer", STATE_REL2, 1.2, 1.0);
221 set_state_anim(PART:"sizer", "custom", 0.0, LINEAR, 1.0);
222 }
223 else {
224 set_state_anim(PART:"sizer", "default", 0.0, LINEAR, 1.0);
225 }
226 } 132 }
227 } 133 }
228 emit("e,state,resized", "e"); 134 emit("e,state,resized", "e");