first commit
This commit is contained in:
131
qml/content/ControlPanel.qml
Normal file
131
qml/content/ControlPanel.qml
Normal file
@@ -0,0 +1,131 @@
|
||||
import QtQuick
|
||||
import QtQuick3D
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQml
|
||||
import "."
|
||||
|
||||
Pane {
|
||||
id: root
|
||||
Material.theme: darkModeToggle.checked ? Material.Dark : Material.Light
|
||||
Material.accent: Material.Green
|
||||
leftPadding: 18
|
||||
rightPadding: 18
|
||||
topPadding: 18
|
||||
bottomPadding: 18
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 14
|
||||
|
||||
Toggle {
|
||||
id: darkModeToggle
|
||||
text: qsTr("Dark mode")
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Render")
|
||||
Layout.fillWidth: true
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 10
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Mode"); Layout.alignment: Qt.AlignVCenter }
|
||||
ComboBox {
|
||||
id: renderModeBox
|
||||
Layout.fillWidth: true
|
||||
model: ["dataViz", "realistic"]
|
||||
Component.onCompleted: currentIndex = backend.renderMode === "realistic" ? 1 : 0
|
||||
onActivated: backend.renderMode = currentText
|
||||
Connections {
|
||||
target: backend
|
||||
function onRenderModeChanged() {
|
||||
renderModeBox.currentIndex = backend.renderMode === "realistic" ? 1 : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Labels"); Layout.alignment: Qt.AlignVCenter }
|
||||
ComboBox {
|
||||
id: labelModeBox
|
||||
Layout.fillWidth: true
|
||||
model: ["off", "hover", "always"]
|
||||
Component.onCompleted: {
|
||||
if (backend.labelMode === "always") labelModeBox.currentIndex = 2
|
||||
else if (backend.labelMode === "hover") labelModeBox.currentIndex = 1
|
||||
else labelModeBox.currentIndex = 0
|
||||
}
|
||||
onActivated: backend.labelMode = currentText
|
||||
Connections {
|
||||
target: backend
|
||||
function onLabelModeChanged() {
|
||||
if (backend.labelMode === "always") labelModeBox.currentIndex = 2
|
||||
else if (backend.labelMode === "hover") labelModeBox.currentIndex = 1
|
||||
else labelModeBox.currentIndex = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Toggle {
|
||||
id: legendToggle
|
||||
text: qsTr("Legend")
|
||||
checked: backend.showLegend
|
||||
onCheckedChanged: backend.showLegend = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Scale")
|
||||
Layout.fillWidth: true
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 10
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Min"); Layout.alignment: Qt.AlignVCenter }
|
||||
SpinBox {
|
||||
id: minBox
|
||||
Layout.fillWidth: true
|
||||
from: -999999
|
||||
to: 999999
|
||||
value: backend.minValue
|
||||
onValueModified: backend.minValue = value
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: qsTr("Max"); Layout.alignment: Qt.AlignVCenter }
|
||||
SpinBox {
|
||||
id: maxBox
|
||||
Layout.fillWidth: true
|
||||
from: -999999
|
||||
to: 999999
|
||||
value: backend.maxValue
|
||||
onValueModified: backend.maxValue = value
|
||||
}
|
||||
}
|
||||
|
||||
Legend {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: backend.showLegend
|
||||
minValue: backend.minValue
|
||||
maxValue: backend.maxValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item { Layout.fillHeight: true }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user