summaryrefslogtreecommitdiff
path: root/tests/data/test-script-signals.json
blob: 0d3f6bd258ed53cbbf0344d23ae5029aec49366e (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
[
  {
    "id" : "button",
    "type" : "ClutterRectangle",

    "width" : "16 em",
    "height" : "6 em",

    "color" : "rgb(255, 0, 0)",
    "opacity" : 128,

    "scale-gravity" : "center",

    "reactive" : true,

    "signals" : [
      {
        "name" : "button-press-event",
        "handler" : "on_button_press"
      },
      { "name" : "enter-event", "states" : "button-states", "target-state" : "hover" },
      { "name" : "leave-event", "states" : "button-states", "target-state" : "base" },
      { "name" : "button-press-event", "states" : "button-states", "target-state" : "active" },
      { "name" : "button-release-event", "states" : "button-states", "target-state" : "hover" }
    ]
  },

  {
    "id" : "button-states",
    "type" : "ClutterState",

    "duration" : 250,

    "transitions" : [
      {
        "source" : null,
        "target" : "base",

        "keys" : [
          [ "button", "opacity", "linear", 128 ],
          [ "button", "scale-x", "ease-in-cubic", 1.0 ],
          [ "button", "scale-y", "ease-in-cubic", 1.0 ],
          [ "button", "color", "linear", "rgb(255, 0, 0)" ]
        ]
      },
      {
        "source" : null,
        "target" : "hover",

        "keys" : [
          [ "button", "opacity", "linear", 255 ],
          [ "button", "scale-x", "ease-out-bounce", 1.4 ],
          [ "button", "scale-y", "ease-out-bounce", 1.4 ],
          [ "button", "color", "linear", "rgb(0, 255, 0)" ]
        ]
      },
      {
        "source" : null,
        "target" : "active",

        "keys" : [
          [ "button", "opacity", "linear", 255 ],
          [ "button", "color", "linear", "rgb(0, 0, 255)" ]
        ]
      }
    ]
  }
]