2020-06-18 18:25:03 -06:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.5
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import Magnum 1.0
|
|
|
|
|
|
|
|
ApplicationWindow {
|
2020-06-23 16:29:36 -06:00
|
|
|
id: app
|
2020-06-18 18:25:03 -06:00
|
|
|
visible: true
|
|
|
|
width: 640
|
|
|
|
height: 480
|
|
|
|
title: qsTr("My Application")
|
|
|
|
|
2020-06-23 16:29:36 -06:00
|
|
|
Shortcut {
|
|
|
|
sequence: "q"
|
|
|
|
onActivated: app.close()
|
|
|
|
}
|
|
|
|
|
|
|
|
Shortcut {
|
|
|
|
sequence: "l"
|
|
|
|
onActivated: lagging.checked = !lagging.checked
|
|
|
|
}
|
|
|
|
|
2020-06-18 18:25:03 -06:00
|
|
|
RowLayout {
|
|
|
|
id: root
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.preferredWidth: parent.width * 0.25
|
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
|
|
|
Layout.margins: 20
|
|
|
|
spacing: 20
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Controls"
|
|
|
|
font.pointSize: 14
|
|
|
|
}
|
|
|
|
GroupBox {
|
|
|
|
Layout.preferredWidth: parent.width
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.preferredWidth: parent.width/4
|
|
|
|
text: "Hue"
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: qsTr("%1°").arg(Math.round((180/Math.PI)*hue.value))
|
|
|
|
color: palette.highlight
|
|
|
|
}
|
|
|
|
Slider {
|
|
|
|
id: hue
|
|
|
|
anchors.right: parent.right
|
|
|
|
Layout.preferredWidth: parent.width/2
|
|
|
|
|
|
|
|
from: 0
|
|
|
|
to: Math.PI*2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupBox {
|
|
|
|
Layout.preferredWidth: parent.width
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.preferredWidth: parent.width/4
|
|
|
|
text: "Count"
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: count.value
|
|
|
|
color: palette.highlight
|
|
|
|
}
|
|
|
|
Slider {
|
|
|
|
id: count
|
|
|
|
anchors.right: parent.right
|
|
|
|
Layout.preferredWidth: parent.width/2
|
|
|
|
|
|
|
|
from: 1
|
|
|
|
to: 5
|
|
|
|
stepSize: 1
|
|
|
|
snapMode: Slider.SnapAlways
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
Layout.preferredWidth: parent.width
|
|
|
|
|
|
|
|
CheckBox {
|
2020-06-23 16:29:36 -06:00
|
|
|
id: lagging
|
|
|
|
text: "Lagging (L)"
|
|
|
|
onCheckStateChanged: {
|
|
|
|
if (checked)
|
|
|
|
magnum.lagging = 0.85
|
|
|
|
else
|
|
|
|
magnum.lagging = 0
|
|
|
|
}
|
2020-06-18 18:25:03 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Magnum {
|
2020-06-23 16:29:36 -06:00
|
|
|
id: magnum
|
2020-06-18 18:25:03 -06:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
hue: hue.value
|
|
|
|
count: count.value
|
|
|
|
|
|
|
|
SequentialAnimation on t {
|
2020-06-23 00:38:55 -06:00
|
|
|
NumberAnimation { to: 10; duration: 10000; easing.type: Easing.InQuad }
|
|
|
|
NumberAnimation { to: 0; duration: 10000; easing.type: Easing.OutQuad }
|
2020-06-18 18:25:03 -06:00
|
|
|
loops: Animation.Infinite
|
|
|
|
running: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|