summaryrefslogtreecommitdiffstats
path: root/res/qml/ControlButton.qml
blob: 6a44ef06e2f97fc4e63737d8c5e35f71f7b6771c (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
import "." as Skin
import Mixxx 0.1 as Mixxx

Skin.Button {
    id: root

    property string group // required
    property string key // required
    property bool toggleable: false

    function toggle() {
        control.value = !control.value;
    }

    highlight: control.value
    onPressed: {
        if (toggleable)
            toggle();
        else
            control.value = 1;
    }
    onReleased: {
        if (!toggleable)
            control.value = 0;

    }

    Mixxx.ControlProxy {
        id: control

        group: root.group
        key: root.key
    }

}