Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FactTextFieldGrid: Use shortDescription by default #12532

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading