Add torch control page

This commit is contained in:
2023-03-05 02:26:49 +01:00
parent e081b199fa
commit 8c610b1f68
3 changed files with 89 additions and 42 deletions

View File

@ -67,6 +67,7 @@ qt_add_qml_module(appscheincommander
AnimatedStackView.qml
Devices3dView.qml
DoubleSpinBox.qml
TorchControlPage.qml
)
add_definitions(-DCMAKE_PROJECT_VERSION=${CMAKE_PROJECT_VERSION})

View File

@ -9,25 +9,52 @@ Item {
property bool needsRegler: true
Button {
ColumnLayout {
anchors.top: parent.top
anchors.right: parent.right
width: 100
height: 100
text: qsTr('Settings')
Button {
width: 100
height: 100
Layout.minimumWidth: width
Layout.minimumHeight: height
Layout.maximumWidth: width
Layout.maximumHeight: height
onClicked: stackview.push(settingsPage)
text: qsTr('Settings')
Component {
id: settingsPage
onClicked: stackview.push(settingsPage)
SettingsPage {
Component {
id: settingsPage
SettingsPage {
}
}
}
Button {
width: 100
height: 100
Layout.minimumWidth: width
Layout.minimumHeight: height
Layout.maximumWidth: width
Layout.maximumHeight: height
text: qsTr('Torch\nControl')
onClicked: stackview.push(torchControlPage)
Component {
id: torchControlPage
TorchControlPage {
}
}
}
}
Flow{
Flow {
anchors.fill: parent
flow: Flow.TopToBottom
@ -45,38 +72,5 @@ Item {
}
}
}
CheckBox {
id: animationCheckbox
text: qsTr('Animation')
}
}
property int test0
onTest0Changed: __controller.setPresetSlider(7, test0);
property int test1
onTest1Changed: __controller.setPresetSlider(15, test1);
property int test2
onTest2Changed: __controller.setPresetSlider(9, test2);
property int test3
onTest3Changed: __controller.setPresetSlider(13, test3);
SequentialAnimation {
loops: Animation.Infinite
running: animationCheckbox.checked
ParallelAnimation {
NumberAnimation { target: homePage; property: "test0"; duration: 2000; from: 10; to: 255; easing.type: Easing.InQuad }
NumberAnimation { target: homePage; property: "test1"; duration: 2000; from: 255; to: 10; easing.type: Easing.InQuad } // blau
NumberAnimation { target: homePage; property: "test2"; duration: 2000; from: 255; to: 10; easing.type: Easing.InQuad } // blau
NumberAnimation { target: homePage; property: "test3"; duration: 2000; from: 10; to: 255; easing.type: Easing.InQuad }
}
PauseAnimation { duration: 1000 }
ParallelAnimation {
NumberAnimation { target: homePage; property: "test0"; duration: 2000; from: 255; to: 10; easing.type: Easing.InQuad }
NumberAnimation { target: homePage; property: "test1"; duration: 2000; from: 10; to: 255; easing.type: Easing.InQuad } // blau
NumberAnimation { target: homePage; property: "test2"; duration: 2000; from: 10; to: 255; easing.type: Easing.InQuad } // blau
NumberAnimation { target: homePage; property: "test3"; duration: 2000; from: 255; to: 10; easing.type: Easing.InQuad }
}
PauseAnimation { duration: 1000 }
}
}

52
TorchControlPage.qml Normal file
View File

@ -0,0 +1,52 @@
import QtQuick
import scheincommander
Item {
Rectangle {
id: torchArea
anchors.centerIn: parent
width: 500
height: 500
Repeater {
model: DevicesModel {
controller: __controller
}
delegate: Rectangle {
width: 10
height: 10
x: (torchArea.width / 2) + (model.position.x / 10 * torchArea.width / 2) - (width / 2)
y: (torchArea.height / 2) + (model.position.z / 10 * torchArea.height / 2) - (height / 1)
color: Qt.rgba(255, 0, 0)
radius: width/2
}
}
MultiPointTouchArea {
anchors.fill: parent
touchPoints: [
TouchPoint { id: point1 },
TouchPoint { id: point2 }
]
}
Rectangle {
width: 30; height: 30
color: "green"
x: point1.x
y: point1.y
}
Rectangle {
width: 30; height: 30
color: "yellow"
x: point2.x
y: point2.y
}
}
}