Commit 6547d68e authored by DonLakeFlyer's avatar DonLakeFlyer

parent 74fb1dae
...@@ -32,128 +32,137 @@ T.VerticalFactValueGrid { ...@@ -32,128 +32,137 @@ T.VerticalFactValueGrid {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled } QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
RowLayout { QGCFlickable {
id: topLevelRowLayout width: parent.width
width: parent.width height: topLevelRowLayout.height
flickableDirection: QGCFlickable.HorizontalFlick
contentWidth: topLevelRowLayout.width
RowLayout {
id: topLevelRowLayout
spacing: 0
ColumnLayout {
spacing: 0
GridLayout {
id: valueGrid
Layout.minimumWidth: _root.width - (columnButtons.visible? columnButtons.width + columnSpacing : 0)
rows: _root.rows.count * 2
rowSpacing: 0
columnSpacing: 5
ColumnLayout { Repeater {
Layout.fillWidth: true model: _root.rows
Repeater {
id: labelRepeater
model: object
GridLayout { property real _index: index
id: valueGrid
Layout.preferredWidth: _root.width
rows: _root.rows.count * 2
rowSpacing: 0
Repeater { InstrumentValueLabel {
model: _root.rows Layout.row: labelRepeater._index * 2
Layout.column: index
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
instrumentValueData: object
}
}
}
Repeater { Repeater {
id: labelRepeater model: _root.rows
model: object
Repeater {
id: valueRepeater
model: object
property real _index: index property real _index: index
InstrumentValueLabel { InstrumentValueValue {
Layout.row: labelRepeater._index * 2 Layout.row: valueRepeater._index * 2 + 1
Layout.column: index Layout.column: index
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
instrumentValueData: object instrumentValueData: object
}
} }
} }
} }
Repeater { RowLayout {
model: _root.rows id: rowButtons
height: ScreenTools.minTouchPixels / 2
Repeater { Layout.fillWidth: true
id: valueRepeater spacing: 1
model: object visible: settingsUnlocked
property real _index: index QGCButton {
Layout.fillWidth: true
Layout.preferredHeight: parent.height
text: qsTr("+")
onClicked: appendRow()
}
InstrumentValueValue { QGCButton {
Layout.row: valueRepeater._index * 2 + 1 Layout.fillWidth: true
Layout.column: index Layout.preferredHeight: parent.height
Layout.fillWidth: true text: qsTr("-")
Layout.alignment: Qt.AlignHCenter enabled: _root.rows.count > 1
instrumentValueData: object onClicked: deleteLastRow()
}
} }
} }
} }
RowLayout { ColumnLayout {
id: rowButtons id: columnButtons
height: ScreenTools.minTouchPixels / 2 Layout.fillHeight: true
Layout.fillWidth: true Layout.bottomMargin: rowButtons.height
spacing: 1 width: ScreenTools.minTouchPixels / 2
visible: settingsUnlocked spacing: 1
visible: settingsUnlocked
QGCButton { QGCButton {
Layout.fillWidth: true Layout.fillHeight: true
Layout.preferredHeight: parent.height Layout.preferredHeight: ScreenTools.minTouchPixels
Layout.preferredWidth: parent.width
text: qsTr("+") text: qsTr("+")
onClicked: appendRow() onClicked: appendColumn()
} }
QGCButton { QGCButton {
Layout.fillWidth: true Layout.fillHeight: true
Layout.preferredHeight: parent.height Layout.preferredHeight: ScreenTools.minTouchPixels
Layout.preferredWidth: parent.width
text: qsTr("-") text: qsTr("-")
enabled: _root.rows.count > 1 enabled: _root.columnCount > 1
onClicked: deleteLastRow() onClicked: deleteLastColumn()
} }
} }
} }
ColumnLayout { QGCMouseArea {
Layout.fillHeight: true x: valueGrid.x
Layout.bottomMargin: rowButtons.height y: valueGrid.y
width: ScreenTools.minTouchPixels / 2 width: valueGrid.width
spacing: 1 height: valueGrid.height
visible: settingsUnlocked visible: settingsUnlocked
onClicked: {
QGCButton { var item = valueGrid.childAt(mouse.x, mouse.y)
Layout.fillHeight: true //console.log(item, item ? item.instrumentValueData : "null", item && item.parent ? item.parent.instrumentValueData : "null")
Layout.preferredHeight: ScreenTools.minTouchPixels if (item && item.instrumentValueData !== undefined) {
Layout.preferredWidth: parent.width mainWindow.showPopupDialogFromComponent(valueEditDialog, { instrumentValueData: item.instrumentValueData })
text: qsTr("+") }
onClicked: appendColumn()
}
QGCButton {
Layout.fillHeight: true
Layout.preferredHeight: ScreenTools.minTouchPixels
Layout.preferredWidth: parent.width
text: qsTr("-")
enabled: _root.columnCount > 1
onClicked: deleteLastColumn()
}
}
}
QGCMouseArea {
x: valueGrid.x
y: valueGrid.y
width: valueGrid.width
height: valueGrid.height
visible: settingsUnlocked
onClicked: {
var item = valueGrid.childAt(mouse.x, mouse.y)
//console.log(item, item ? item.instrumentValueData : "null", item && item.parent ? item.parent.instrumentValueData : "null")
if (item && item.instrumentValueData !== undefined) {
mainWindow.showPopupDialogFromComponent(valueEditDialog, { instrumentValueData: item.instrumentValueData })
} }
}
/*Rectangle { /*Rectangle {
anchors.fill: parent anchors.fill: parent
border.color: "green" border.color: "green"
border.width: 1 border.width: 1
color: "transparent" color: "transparent"
}*/ }*/
}
} }
Component { Component {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment