0
|
1 // define what a Button really is...
|
|
2 widget Button {
|
|
3 layout = Layered;
|
|
4 size = 30 0;
|
|
5
|
|
6 [hfill vfill] new Graphic body {
|
|
7 size = 0 23;
|
|
8
|
|
9 style.normal = {
|
|
10 image = grid("themes/default/img/button.png", hline(2, 73), vline(2, 21));
|
|
11 background = solid(white);
|
|
12 }
|
|
13
|
|
14 style.active = {
|
|
15 image = grid("themes/default/img/button_active.png", hline(2, 73), vline(2, 21));
|
|
16 }
|
|
17 }
|
|
18
|
|
19 [hfill vfill] new Graphic bodyOver {
|
|
20 style.normal = {
|
|
21 background = solid(rgba(1, 1, 1, 0));
|
|
22 }
|
|
23
|
|
24 style.hover = {
|
|
25 background = solid(rgba(1, 1, 1, .07));
|
|
26 deactivation = .3;
|
|
27 }
|
|
28 }
|
|
29
|
|
30 [hfill vfill] new HBox {
|
|
31 layout = {
|
|
32 padding = 6 3;
|
|
33 spacing = 2;
|
|
34 }
|
|
35
|
|
36 [hexpand vexpand] new HBox leftExtra;
|
|
37 [vexpand] new Label text {
|
|
38 style.normal = {
|
|
39 color = rgb(.8, .8, .8);
|
|
40 }
|
|
41
|
|
42 text = "Button";
|
|
43 fontSize = 11;
|
|
44 }
|
|
45 [hexpand vexpand] new HBox rightExtra;
|
|
46 }
|
|
47
|
|
48 leftExtra = sub(leftExtra);
|
|
49 rightExtra = sub(rightExtra);
|
|
50 label = sub(text);
|
|
51 text = prop(text.text);
|
|
52 }
|