summaryrefslogtreecommitdiffstats
path: root/res/qml/ControlButton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'res/qml/ControlButton.qml')
-rw-r--r--res/qml/ControlButton.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/res/qml/ControlButton.qml b/res/qml/ControlButton.qml
new file mode 100644
index 0000000000..6a44ef06e2
--- /dev/null
+++ b/res/qml/ControlButton.qml
@@ -0,0 +1,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
+ }
+
+}