62 lines
2.1 KiB
QML
62 lines
2.1 KiB
QML
import QtQuick 2.12
|
|
import QtQuick.Controls 2.12
|
|
import QtQuick.Layouts 1.12
|
|
import "../components/pipeline"
|
|
import "../shared/Theme.js" as Theme
|
|
|
|
Rectangle {
|
|
color: Theme.panelBg
|
|
property int compactH: Theme.compactControlHeight
|
|
readonly property var safeBackend: backend ? backend : ({
|
|
surfaceVisible: true,
|
|
demoSurfaceTypes: ["Сфера", "Тор", "Волна"],
|
|
demoSurfaceType: "Сфера",
|
|
openPointsFile: function() {},
|
|
generateDemo: function() {},
|
|
setDemoSurfaceType: function(_) {},
|
|
setSurfaceVisible: function(_) {},
|
|
applyPipelineFromUi: function() {}
|
|
})
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
anchors.margins: Theme.spacingMd
|
|
spacing: Theme.spacingSm
|
|
|
|
RowLayout {
|
|
Layout.fillWidth: true
|
|
spacing: Theme.spacingSm
|
|
ComboBox {
|
|
Layout.preferredWidth: Theme.dashboardSurfaceComboWidth
|
|
Layout.preferredHeight: compactH
|
|
model: safeBackend.demoSurfaceTypes
|
|
currentIndex: model.indexOf(safeBackend.demoSurfaceType)
|
|
onActivated: safeBackend.setDemoSurfaceType(currentText)
|
|
}
|
|
Button { text: "Сгенерировать"; height: compactH; onClicked: safeBackend.generateDemo() }
|
|
Button { text: "Загрузить"; height: compactH; onClicked: safeBackend.openPointsFile() }
|
|
Item { Layout.fillWidth: true }
|
|
}
|
|
|
|
PipelineCanvas {
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
}
|
|
|
|
RowLayout {
|
|
Layout.fillWidth: true
|
|
spacing: Theme.spacingSm
|
|
Switch { checked: safeBackend.surfaceVisible; onToggled: safeBackend.setSurfaceVisible(checked) }
|
|
Item { Layout.fillWidth: true }
|
|
Button { text: "Применить"; Layout.preferredHeight: compactH; onClicked: safeBackend.applyPipelineFromUi() }
|
|
}
|
|
|
|
MetricsStrip {
|
|
Layout.fillWidth: true
|
|
Layout.preferredHeight: Theme.dashboardMetricsHeight
|
|
Layout.bottomMargin: Theme.dashboardBottomMargin
|
|
}
|
|
|
|
}
|
|
}
|