This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/guh-control/ui/actiondelegates/ActionDelegateSlider.qml
Michael Zanetti 93c91d71bd more work
2018-02-25 05:48:36 +01:00

36 lines
1.1 KiB
QML

import QtQuick 2.5
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
ActionDelegateBase {
id: root
height: columnLayout.height + app.margins
ColumnLayout {
id: columnLayout
anchors { left: parent.left; right: parent.right; top: parent.top; margins: app.margins }
Label {
Layout.fillWidth: true
text: root.actionType.paramTypes.get(0).displayName
}
Slider {
Layout.fillWidth: true
from: root.actionType ? root.actionType.paramTypes.get(0).minValue : 0
to: root.actionType ? root.actionType.paramTypes.get(0).maxValue : 100000000
value: root.actionState
onValueChanged: {
if (pressed) {
var params = [];
var param1 = {};
param1["paramTypeId"] = root.actionType.paramTypes.get(0).id;
param1["value"] = value;
params.push(param1)
root.executeAction(params)
}
}
}
}
}