summaryrefslogtreecommitdiffstats
path: root/res/qml/HotcueButton.qml
blob: 4aa2d1a691ad65bf2db8756537b3c121e8af2dbe (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
import "." as Skin
import QtQuick 2.12
import QtQuick.Controls 2.12
import "Theme"

Skin.Button {
    id: root

    property int hotcueNumber // required
    property string group // required

    text: hotcueNumber
    width: playButton.height
    height: playButton.height
    activeColor: hotcue.color
    highlight: hotcue.isSet

    Hotcue {
        id: hotcue

        group: root.group
        hotcueNumber: root.hotcueNumber
        activate: root.down
        onIsSetChanged: {
            if (!isSet)
                popup.close();

        }
    }

    HotcuePopup {
        id: popup

        hotcue: hotcue
    }

    MouseArea {
        id: mousearea

        anchors.fill: parent
        acceptedButtons: Qt.RightButton
        onClicked: {
            if (hotcue.isSet) {
                popup.x = mouse.x;
                popup.y = mouse.y;
                popup.open();
            }
        }
    }

}