Skip to content

Commit

Permalink
Use shortDescription by default
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Mar 2, 2025
1 parent 3b2ead2 commit 2d4319c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/FactSystem/FactControls/FactTextFieldGrid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ import QGroundControl.FactSystem
import QGroundControl.Controls

GridLayout {
property var factList ///< List of Facts to show
property var factLabels ///< Labels for facts, if not set, use Fact.name
property var factList ///< List of Facts to show
property var factLabels ///< Labels for facts, if not set, use Fact.name or Fact.shortDescription
property bool useNameForLabels: true ///< true: Use Fact.name for labels, false: Use Fact.shortDescription

rows: factList.length
flow: GridLayout.TopToBottom

Repeater {
model: parent.factList

QGCLabel { text: factLabels ? factLabels[index] : modelData.name }
QGCLabel {
text: {
if (factLabels) {
return factLabels[index]
} else if (useNameForLabels) {
return modelData.name
} else {
return modelData.shortDescription
}
}
}
}

Repeater {
Expand Down

0 comments on commit 2d4319c

Please sign in to comment.