diff options
author | Be <be@mixxx.org> | 2021-09-30 10:44:39 -0500 |
---|---|---|
committer | Be <be@mixxx.org> | 2021-09-30 10:44:39 -0500 |
commit | f58f68ebb52c3d9af85101985a99800f0dd47487 (patch) | |
tree | b8b68d79b3355707fab512226d846f64c5a43529 /res/qml/HotcueButton.qml | |
parent | 4d7bde1d00dd445b47edb46d93709a52bfc5a0fd (diff) | |
parent | 49e87f9889b9eef5c9cc7d13fa9395555b7729eb (diff) |
Merge remote-tracking branch 'upstream/main' into effects_refactoring
Diffstat (limited to 'res/qml/HotcueButton.qml')
-rw-r--r-- | res/qml/HotcueButton.qml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/res/qml/HotcueButton.qml b/res/qml/HotcueButton.qml new file mode 100644 index 0000000000..4aa2d1a691 --- /dev/null +++ b/res/qml/HotcueButton.qml @@ -0,0 +1,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(); + } + } + } + +} |