Mercurial > projects > dynamin
annotate dynamin/gui/layout.d @ 38:69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Wed, 29 Jul 2009 23:25:29 -0500 |
parents | f9fea816b1fb |
children | 04d2867d335c |
rev | line source |
---|---|
0 | 1 // Written in the D programming language |
2 // www.digitalmars.com/d/ | |
3 | |
4 /* | |
5 * The contents of this file are subject to the Mozilla Public License Version | |
6 * 1.1 (the "License"); you may not use this file except in compliance with | |
7 * the License. You may obtain a copy of the License at | |
8 * http://www.mozilla.org/MPL/ | |
9 * | |
10 * Software distributed under the License is distributed on an "AS IS" basis, | |
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
12 * for the specific language governing rights and limitations under the | |
13 * License. | |
14 * | |
15 * The Original Code is the Dynamin library. | |
16 * | |
17 * The Initial Developer of the Original Code is Jordan Miner. | |
18 * Portions created by the Initial Developer are Copyright (C) 2007-2009 | |
19 * the Initial Developer. All Rights Reserved. | |
20 * | |
21 * Contributor(s): | |
22 * Jordan Miner <jminer7@gmail.com> | |
23 * | |
24 */ | |
25 | |
26 module dynamin.gui.layout; | |
27 | |
28 import dynamin.all_gui; | |
29 import dynamin.gui.control; | |
30 import dynamin.all_painting; | |
31 import dynamin.core.string; | |
32 import tango.io.Stdout; | |
33 import dynamin.core.benchmark; | |
34 | |
35 // this is a temporary file to hold layout code until I figure out what | |
36 // files to put it in | |
37 | |
38 /* | |
39 Opera's find dialog: | |
40 | |
41 auto whatLabel = win.content.add(new Label("Find What")); | |
42 ... | |
43 | |
44 V( whatLabel | |
45 H( findBox findButton ) | |
46 H( V(wholeWordCheck caseCheck) ~ V(upRadio downRadio) ~) | |
47 H( ~ closeButton ) | |
48 ) | |
49 */ | |
50 | |
51 enum LayoutType { | |
52 None, Table, Control, Filler, Spacer | |
53 } | |
54 enum Elasticity { | |
55 No, Semi, Yes | |
56 } | |
57 struct LayoutGroup { | |
58 LayoutType type; | |
59 LayoutGroup* parent; | |
37
f9fea816b1fb
Correct a comment and remove an unused variable.
Jordan Miner <jminer7@gmail.com>
parents:
11
diff
changeset
|
60 LayoutGroup[] children; // used if type == LayoutType.Table |
0 | 61 Control control; // used if type == LayoutType.Control |
62 int numColumns; // used if type == LayoutType.Table | |
63 int numRows() { return children.length / numColumns; } | |
64 | |
65 bool cacheActive; | |
66 private Elasticity _elasticXCache, _elasticYCache; | |
67 private Size _bestSizeCache; | |
68 private int _baselineCache; | |
69 | |
70 // spacing variables | |
71 int spacing = 8; | |
72 static LayoutGroup opCall(LayoutType type, LayoutGroup* parent) { | |
73 LayoutGroup layout; | |
74 layout.type = type; | |
75 layout.parent = parent; | |
76 layout.children.length = 3; | |
77 layout.children.length = 0; | |
78 return layout; | |
79 } | |
80 | |
81 void setCache() { | |
82 for(int i = 0; i < children.length; ++i) // can't use foreach--copies | |
83 children[i].setCache(); | |
84 _elasticXCache = _elasticX; | |
85 _elasticYCache = _elasticY; | |
86 _bestSizeCache = _bestSize; | |
87 _baselineCache = _baseline; | |
88 cacheActive = true; | |
89 } | |
90 void clearCache() { | |
91 cacheActive = false; | |
92 for(int i = 0; i < children.length; ++i) // can't use foreach--copies | |
93 children[i].clearCache(); | |
94 } | |
95 Elasticity elasticX() { return cacheActive ? _elasticXCache : _elasticX; } | |
96 Elasticity elasticY() { return cacheActive ? _elasticYCache : _elasticY; } | |
97 Size bestSize() { return cacheActive ? _bestSizeCache : _bestSize; } | |
98 int baseline() { return cacheActive ? _baselineCache : _baseline; } | |
99 | |
100 //{{{ _elasticX() | |
101 private Elasticity _elasticX() { | |
102 switch(type) { | |
103 case LayoutType.Control: | |
104 return control.elasticX ? Elasticity.Yes : Elasticity.No; | |
105 case LayoutType.Table: | |
106 auto e = Elasticity.No; | |
107 foreach(layout; children) { | |
108 if(layout.elasticX > e) | |
109 e = layout.elasticX; | |
110 if(e == Elasticity.Yes) | |
111 return e; | |
112 } | |
113 return e; | |
114 case LayoutType.Filler: | |
38
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
115 if(!parent || parent.numColumns > 1 || children.length == 1) |
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
116 return Elasticity.Semi; |
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
117 else |
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
118 return Elasticity.No; |
0 | 119 case LayoutType.Spacer: |
120 return Elasticity.No; | |
121 } | |
122 } | |
123 //}}} | |
124 //{{{ _elasticY() | |
125 private Elasticity _elasticY() { | |
126 switch(type) { | |
127 case LayoutType.Control: | |
128 return control.elasticY ? Elasticity.Yes : Elasticity.No; | |
129 case LayoutType.Table: | |
130 auto e = Elasticity.No; | |
131 foreach(layout; children) { | |
132 if(layout.elasticY > e) | |
133 e = layout.elasticY; | |
134 if(e == Elasticity.Yes) | |
135 return e; | |
136 } | |
137 return e; | |
138 case LayoutType.Filler: | |
38
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
139 if(!parent || parent.numRows > 1 || children.length == 1) |
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
140 return Elasticity.Semi; |
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
141 else |
69df5369c5f7
Fix filler to only be elastic in the direction of its parent.
Jordan Miner <jminer7@gmail.com>
parents:
37
diff
changeset
|
142 return Elasticity.No; |
0 | 143 case LayoutType.Spacer: |
144 return Elasticity.No; | |
145 } | |
146 } | |
147 //}}} | |
148 | |
149 //{{{ _bestSize() | |
150 private Size _bestSize() { | |
151 switch(type) { | |
152 case LayoutType.Control: | |
153 return control.bestSize; | |
154 case LayoutType.Table: | |
155 scope colsInfo = new ColRowInfo[numColumns]; | |
156 scope rowsInfo = new ColRowInfo[numRows]; | |
157 TableInfo info; | |
158 getTableSizes(colsInfo, rowsInfo, info); | |
159 return info.bestSize; | |
160 case LayoutType.Filler: | |
161 case LayoutType.Spacer: | |
162 return Size(0, 0); | |
163 } | |
164 } | |
165 //}}} | |
166 //{{{ _baseline() | |
167 private int _baseline() { | |
168 switch(type) { | |
169 case LayoutType.Control: | |
170 return control.baseline; | |
171 case LayoutType.Table: | |
172 case LayoutType.Filler: | |
173 case LayoutType.Spacer: | |
174 return 0; | |
175 } | |
176 } | |
177 //}}} | |
178 | |
179 //{{{ layout() | |
180 void layout(Rect rect) { | |
181 switch(type) { | |
182 case LayoutType.Control: | |
183 control.location = Point(rect.x, rect.y); | |
184 control.size = Size(rect.width, rect.height); | |
185 return; | |
186 case LayoutType.Table: | |
187 scope colsInfo = new ColRowInfo[numColumns]; | |
188 scope rowsInfo = new ColRowInfo[numRows]; | |
189 TableInfo info; | |
190 getTableSizes(colsInfo, rowsInfo, info); | |
191 | |
192 real extraWidth = rect.width - bestSize.width; | |
193 real extraHeight = rect.height - bestSize.height; | |
194 | |
195 void distExtra(ref real extra, ref ColRowInfo info, | |
196 ref real totalElastic, ref int semis, Elasticity e) { | |
197 if(info.elastic == Elasticity.No || extra <= 0) | |
198 return; | |
199 if(e == Elasticity.Semi && | |
200 info.elastic == Elasticity.Semi) { | |
201 auto thisExtra = extra / semis; | |
202 extra -= thisExtra; | |
203 semis--; | |
204 info.bestSize += thisExtra; | |
205 } else if(e == Elasticity.Yes && | |
206 info.elastic == Elasticity.Yes) { | |
207 auto thisExtra = extra * info.bestSize/totalElastic; | |
208 extra -= thisExtra; | |
209 totalElastic -= info.bestSize; // subtract original size | |
210 info.bestSize += thisExtra; | |
211 } | |
212 } | |
213 real y = 0; | |
214 for(int row = 0; row < numRows; ++row) { // go over each row | |
215 distExtra(extraHeight, rowsInfo[row], info.elasticHeight, info.semiRows, elasticY); | |
216 | |
217 real x = 0; | |
218 for(int col = 0; col < numColumns; ++col) { | |
219 distExtra(extraWidth, colsInfo[col], info.elasticWidth, info.semiColumns, elasticX); | |
220 | |
221 auto layout = children[row * numColumns + col]; | |
222 | |
223 Rect r = Point(x, y) + layout.bestSize; | |
224 | |
225 if(layout.baseline > 0) | |
226 r.y = r.y + rowsInfo[row].baseline - layout.baseline; | |
227 if(layout.elasticX) | |
228 r.width = colsInfo[col].bestSize; | |
229 if(layout.elasticY) | |
230 r.height = rowsInfo[row].bestSize; | |
231 | |
232 layout.layout(r + Point(rect.x, rect.y)); | |
233 | |
234 x += colsInfo[col].bestSize + | |
235 (colsInfo[col].filler ? 0 : spacing); | |
236 } | |
237 y += rowsInfo[row].bestSize + | |
238 (rowsInfo[row].filler ? 0 : spacing); | |
239 } | |
240 return; | |
241 case LayoutType.Filler: | |
242 case LayoutType.Spacer: | |
243 return; | |
244 } | |
245 } | |
246 //}}} | |
247 | |
248 struct ColRowInfo { | |
249 real bestSize = 0; // large enough to hold the largest control | |
250 Elasticity elastic = Elasticity.No; | |
251 bool filler = true; // if the entire column/row is filler | |
252 real baseline; // only applies to rows: max baseline in row | |
253 } | |
254 struct TableInfo { | |
255 // number of semi-elastic columns/rows | |
256 int semiColumns = 0; int semiRows = 0; | |
257 // the sum of fully elastic width/height, not including semi | |
258 real elasticWidth = 0, elasticHeight = 0; | |
259 Size bestSize = Size(0, 0); | |
260 } | |
261 //{{{ getTableSizes() | |
262 // Fills in the passed in array with the column and row sizes, as well | |
263 // as whether they are elastic. The passed in arrays must be the right | |
264 // sizes. They may be stack allocated. The table best size does | |
265 // including spacing, but column and row best sizes do not. | |
266 private void getTableSizes(ColRowInfo[] colsInfo, ColRowInfo[] rowsInfo, ref TableInfo info) { | |
267 assert(children.length % numColumns == 0); | |
268 assert(type == LayoutType.Table); | |
269 | |
270 assert(colsInfo.length == numColumns); | |
271 assert(rowsInfo.length == numRows); | |
272 | |
37
f9fea816b1fb
Correct a comment and remove an unused variable.
Jordan Miner <jminer7@gmail.com>
parents:
11
diff
changeset
|
273 real max = 0; |
0 | 274 LayoutGroup* l; |
275 | |
276 int sp = 0; | |
277 for(int col = 0; col < numColumns; ++col) { // go down each column | |
278 for(int row = 0; row < numRows; ++row) { | |
279 l = &children[row * numColumns + col]; | |
280 max = l.bestSize.width > max ? l.bestSize.width : max; | |
281 if(l.elasticX > colsInfo[col].elastic) | |
282 colsInfo[col].elastic = l.elasticX; | |
283 if(l.type != LayoutType.Filler) | |
284 colsInfo[col].filler = false; | |
285 } | |
286 colsInfo[col].bestSize = max; | |
287 if(colsInfo[col].elastic == Elasticity.Yes) | |
288 info.elasticWidth += max; | |
289 else if(colsInfo[col].elastic == Elasticity.Semi) | |
290 info.semiColumns++; | |
291 info.bestSize.width = info.bestSize.width + sp + max; | |
292 sp = (colsInfo[col].filler ? 0 : spacing); | |
293 max = 0; | |
294 } | |
295 | |
296 real maxBl = 0; | |
297 sp = 0; | |
298 for(int row = 0; row < numRows; ++row) { // go over each row | |
299 for(int col = 0; col < numColumns; ++col) { | |
300 l = &children[row * numColumns + col]; | |
301 max = l.bestSize.height > max ? l.bestSize.height : max; | |
302 maxBl = l.baseline > maxBl ? l.baseline : maxBl; | |
303 if(l.elasticY > rowsInfo[row].elastic) | |
304 rowsInfo[row].elastic = l.elasticY; | |
305 if(l.type != LayoutType.Filler) | |
306 rowsInfo[row].filler = false; | |
307 } | |
308 rowsInfo[row].bestSize = max; | |
309 rowsInfo[row].baseline = maxBl; | |
310 if(rowsInfo[row].elastic == Elasticity.Yes) | |
311 info.elasticHeight += max; | |
312 else if(rowsInfo[row].elastic == Elasticity.Semi) | |
313 info.semiRows++; | |
314 info.bestSize.height = info.bestSize.height + sp + max; | |
315 sp = (rowsInfo[row].filler ? 0 : spacing); | |
316 max = maxBl = 0; | |
317 } | |
318 } | |
319 //}}} | |
320 } | |
321 | |
322 //{{{ LayoutPanel class | |
323 class LayoutPanel : Panel { | |
324 LayoutGroup root; | |
325 LayoutGroup* current; | |
326 void startLayout(int ncolumns) { | |
327 if(current is null) { | |
328 root = LayoutGroup(LayoutType.Table, null); | |
329 root.numColumns = ncolumns; | |
330 current = &root; | |
331 return; | |
332 } | |
333 current.children.length = current.children.length+1; | |
334 current.children[$-1] = LayoutGroup(LayoutType.Table, current); | |
335 current.children[$-1].numColumns = ncolumns; | |
336 current = ¤t.children[$-1]; | |
337 } | |
338 void endLayout() { | |
339 current = current.parent; | |
340 } | |
341 override void add(Control c) { | |
342 if(current is null) | |
343 throw new Exception("Cannot add a control until a layout is started"); | |
344 current.children.length = current.children.length+1; | |
345 current.children[$-1] = LayoutGroup(LayoutType.Control, current); | |
346 current.children[$-1].control = c; | |
347 super.add(c); | |
348 } | |
349 void addFiller() { | |
350 current.children.length = current.children.length+1; | |
351 current.children[$-1] = LayoutGroup(LayoutType.Filler, current); | |
352 } | |
353 void addSpacer() { | |
354 current.children.length = current.children.length+1; | |
355 current.children[$-1] = LayoutGroup(LayoutType.Spacer, current); | |
356 } | |
357 | |
358 override Size bestSize() { | |
359 return root.bestSize + Size(root.spacing*2, root.spacing*2); | |
360 } | |
361 override bool elasticX() { return root.elasticX == Elasticity.Yes; } | |
362 override bool elasticY() { return root.elasticY == Elasticity.Yes; } | |
363 override void layout() { | |
364 //benchmarkAndWrite("layout", { | |
365 root.setCache(); | |
366 int sp = root.spacing; | |
367 root.layout(Rect(sp, sp, width-2*sp, height-2*sp)); | |
368 root.clearCache(); | |
369 //}); | |
370 } | |
371 } | |
372 //}}} | |
373 | |
374 //{{{ createLayout() etc. | |
375 /** | |
376 * Note: if you do this: | |
377 * ----- | |
378 * char[] s = createLayout("V( b1 H(b2 b3) )"); | |
379 * ----- | |
380 * Then the program will crash when compiled with the -release flag. (I am | |
381 * pretty sure it is a DMD bug, but I don't have time to make a testcase | |
382 * for a bug that does not bother me.) This will work correctly: | |
383 * ----- | |
384 * const char[] s = createLayout("V( b1 H(b2 b3) )"); | |
385 * ----- | |
386 * Because then the function is interpreted at compile time with CTFE. | |
387 */ | |
388 string createLayout(string layout) { | |
389 string code = "delegate LayoutPanel() {\n"; | |
390 code ~= "auto panel = new LayoutPanel;\n"; | |
391 assert(getToken(layout) == "H" || getToken(layout) == "V" || | |
392 getToken(layout) == "T", "layout type 'H', 'V', or 'T' expected"); | |
393 code ~= parseLayout(layout); | |
394 code ~= "return panel;\n"; | |
395 code ~= "}()"; | |
396 return code; | |
397 } | |
398 | |
399 void skipWS(ref string str) { | |
400 int i = 0; | |
401 while(" \t\n\r\v\f".contains(str[i])) | |
402 i++; | |
403 str = str[i..$]; | |
404 } | |
405 // advances to the next token and returns it | |
406 string nextToken(ref string str) { | |
407 skipWS(str); | |
408 str = str[getToken(str).length..$]; | |
409 return getToken(str); | |
410 } | |
411 // returns H or V or ( or ) or myControl | |
412 // gets the current token | |
413 string getToken(string str) { | |
414 string idChars = | |
415 "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
416 | |
417 // TODO: // for line comments? | |
418 skipWS(str); | |
11
df1c8e659b75
Change layout language to use * for filler and ~ for spacing. Ticket #24
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
419 if("()[]*~".contains(str[0])) { |
0 | 420 return str[0..1]; |
421 } else if(idChars.contains(str[0])) { | |
422 int i = 1; | |
423 while(idChars.contains(str[i])) | |
424 i++; | |
425 return str[0..i]; | |
426 } else { | |
427 assert(0, "unknown character: " ~ str[0]); | |
428 } | |
429 } | |
430 | |
431 // {{{ copied from Phobos | |
432 char[] ctfeUintToString(uint u) { | |
433 char[uint.sizeof * 3] buffer = void; | |
434 int ndigits; | |
435 char[] result; | |
436 char[] digits = "0123456789"; | |
437 | |
438 ndigits = 0; | |
439 if (u < 10) | |
440 // Avoid storage allocation for simple stuff | |
441 result = digits[u .. u + 1]; | |
442 else | |
443 { | |
444 while (u) | |
445 { | |
446 uint c = (u % 10) + '0'; | |
447 u /= 10; | |
448 ndigits++; | |
449 buffer[buffer.length - ndigits] = cast(char)c; | |
450 } | |
451 result = new char[ndigits]; | |
452 result[] = buffer[buffer.length - ndigits .. buffer.length]; | |
453 } | |
454 return result; | |
455 } | |
456 uint ctfeStringToUint(char[] s) | |
457 { | |
458 int length = s.length; | |
459 | |
460 if (!length) | |
461 return 0; | |
462 | |
463 uint v = 0; | |
464 | |
465 for (int i = 0; i < length; i++) | |
466 { | |
467 char c = s[i]; | |
468 if (c >= '0' && c <= '9') | |
469 { | |
470 if (v < uint.max/10 || (v == uint.max/10 && c <= '5')) | |
471 v = v * 10 + (c - '0'); | |
472 else | |
473 return 0; | |
474 } | |
475 else | |
476 return 0; | |
477 } | |
478 return v; | |
479 } | |
480 //}}} | |
481 | |
482 uint parseBody(ref string layout, ref string bcode) { | |
483 uint count = 0; | |
484 assert(nextToken(layout) == "(", "open parenthesis expected"); | |
485 while(nextToken(layout) != ")") { | |
11
df1c8e659b75
Change layout language to use * for filler and ~ for spacing. Ticket #24
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
486 if(getToken(layout) == "*") |
0 | 487 bcode = bcode ~ "panel.addFiller();\n"; |
11
df1c8e659b75
Change layout language to use * for filler and ~ for spacing. Ticket #24
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
488 else if(getToken(layout) == "~") |
0 | 489 bcode = bcode ~ "panel.addSpacer();\n"; |
490 else | |
491 bcode = bcode ~ parseLayout(layout); | |
492 count++; | |
493 } | |
494 bcode = bcode ~ "panel.endLayout();\n"; | |
495 return count; | |
496 } | |
497 | |
498 string parseLayout(ref string layout) { | |
499 string code = ""; | |
500 | |
501 if(getToken(layout) == "H") { | |
502 string bodyCode; | |
503 auto count = parseBody(layout, bodyCode); | |
504 code ~= "panel.startLayout(" ~ ctfeUintToString(count) ~ ");\n"; | |
505 code ~= bodyCode; | |
506 } else if(getToken(layout) == "V") { | |
507 code ~= "panel.startLayout(1);\n"; | |
508 parseBody(layout, code); | |
509 } else if(getToken(layout) == "T") { | |
510 assert(nextToken(layout) == "[", "open bracket expected"); | |
511 nextToken(layout); | |
512 assert("0123456789".contains(getToken(layout)[0]), | |
513 "number of table columns expected"); | |
514 uint columns = ctfeStringToUint(getToken(layout)); | |
515 code ~= "panel.startLayout(" ~ getToken(layout) ~ ");\n"; | |
516 assert(nextToken(layout) == "]", "close bracket expected"); | |
517 assert(parseBody(layout, code) % columns == 0, | |
518 "number of controls must be a multiple of number of columns"); | |
519 } else { | |
520 code ~= "panel.add(" ~ getToken(layout) ~ ");\n"; | |
521 } | |
522 | |
523 return code; | |
524 } | |
525 | |
526 //{{{ parser tests | |
527 static assert(createLayout("H()") != "not evaluatable at compile time"); | |
528 //pragma(msg, createLayout("V()")); | |
529 | |
530 static assert(createLayout("V(c1 c2)") == | |
531 `delegate LayoutPanel() { | |
532 auto panel = new LayoutPanel; | |
533 panel.startLayout(1); | |
534 panel.add(c1); | |
535 panel.add(c2); | |
536 panel.endLayout(); | |
537 return panel; | |
538 }()`); | |
11
df1c8e659b75
Change layout language to use * for filler and ~ for spacing. Ticket #24
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
539 static assert(createLayout("V(c1 * c2 H(c3 ~) c4)") == |
0 | 540 `delegate LayoutPanel() { |
541 auto panel = new LayoutPanel; | |
542 panel.startLayout(1); | |
543 panel.add(c1); | |
544 panel.addFiller(); | |
545 panel.add(c2); | |
546 panel.startLayout(2); | |
547 panel.add(c3); | |
548 panel.addSpacer(); | |
549 panel.endLayout(); | |
550 panel.add(c4); | |
551 panel.endLayout(); | |
552 return panel; | |
553 }()`); | |
554 static assert(createLayout("V( c1 T[2](c2 c3) c4 )") == | |
555 `delegate LayoutPanel() { | |
556 auto panel = new LayoutPanel; | |
557 panel.startLayout(1); | |
558 panel.add(c1); | |
559 panel.startLayout(2); | |
560 panel.add(c2); | |
561 panel.add(c3); | |
562 panel.endLayout(); | |
563 panel.add(c4); | |
564 panel.endLayout(); | |
565 return panel; | |
566 }()`); | |
567 //}}} | |
568 | |
569 //}}} | |
570 | |
571 unittest { | |
572 // TODO: set to basic theme | |
573 // test a few basic layouts and verify pixel locations and sizes | |
574 } | |
575 |