first commit
This commit is contained in:
6
qml/Main.qml
Normal file
6
qml/Main.qml
Normal file
@@ -0,0 +1,6 @@
|
||||
import QtQuick
|
||||
import "content"
|
||||
|
||||
App {
|
||||
|
||||
}
|
||||
18
qml/content/App.qml
Normal file
18
qml/content/App.qml
Normal file
@@ -0,0 +1,18 @@
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls.Material
|
||||
import "./"
|
||||
|
||||
Rectangle {
|
||||
// width: Constants.width
|
||||
// height: Constants.height
|
||||
width: 360
|
||||
// minimumWidth: 800
|
||||
// minimumHeight: 600
|
||||
|
||||
visible: true
|
||||
|
||||
ControlPanel {
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
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 }
|
||||
}
|
||||
}
|
||||
20
qml/content/LabeledSlider.qml
Normal file
20
qml/content/LabeledSlider.qml
Normal file
@@ -0,0 +1,20 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Slider {
|
||||
property string lableText: qsTr("Text")
|
||||
stepSize: 1
|
||||
|
||||
Label {
|
||||
text: parent.lableText
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.top
|
||||
bottomPadding: -12
|
||||
}
|
||||
Label {
|
||||
text: parent.value
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.top
|
||||
bottomPadding: -12
|
||||
}
|
||||
}
|
||||
49
qml/content/Legend.qml
Normal file
49
qml/content/Legend.qml
Normal file
@@ -0,0 +1,49 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property int minValue: 0
|
||||
property int maxValue: 100
|
||||
|
||||
implicitWidth: 90
|
||||
implicitHeight: 220
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 6
|
||||
|
||||
Label {
|
||||
text: root.maxValue
|
||||
font.pixelSize: 12
|
||||
opacity: 0.9
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillHeight: true
|
||||
width: 26
|
||||
radius: 6
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(1, 1, 1, 0.18)
|
||||
|
||||
gradient: Gradient {
|
||||
// must match shaders/dots.frag:dataColorRamp (high at top)
|
||||
GradientStop { position: 0.00; color: Qt.rgba(1.00, 0.22, 0.10, 1.0) } // c3
|
||||
GradientStop { position: 0.34; color: Qt.rgba(1.00, 0.92, 0.22, 1.0) } // c2
|
||||
GradientStop { position: 0.67; color: Qt.rgba(0.10, 0.95, 0.35, 1.0) } // c1
|
||||
GradientStop { position: 1.00; color: Qt.rgba(0.10, 0.75, 1.00, 1.0) } // c0
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: root.minValue
|
||||
font.pixelSize: 12
|
||||
opacity: 0.9
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
qml/content/Toggle.qml
Normal file
18
qml/content/Toggle.qml
Normal file
@@ -0,0 +1,18 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Item {
|
||||
property string text
|
||||
property alias checked: toggleIndicator.checked
|
||||
|
||||
Label {
|
||||
id: toggleText
|
||||
text: parent.text
|
||||
anchors.verticalCenter: toggleIndicator.verticalCenter
|
||||
}
|
||||
Switch {
|
||||
id: toggleIndicator
|
||||
anchors.left: toggleText.right
|
||||
anchors.leftMargin: 8
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user