5import QGroundControl.Controls
7/// List of the fences and the breach return point of the GeoFence tab
11 required property var page
15 objectName: "planPanel_fenceList"
17 spacing: ScreenTools.defaultFontPixelHeight * 0.1
20 delegate: PlanPanelRow {
23 required property var modelData
25 readonly property var fence: root.page.objectFor(modelData.kind, modelData.index)
27 objectName: "planPanel_fenceRow_" + modelData.key
29 selected: modelData.key === root.page.selectedKey
32 root.page.selectEntry(modelData)
37 Layout.preferredHeight: ScreenTools.defaultFontPixelHeight
38 Layout.preferredWidth: Layout.preferredHeight
39 source: row.modelData.kind === "breach" ? "/res/waypoint.svg" : "/res/GeoFence.svg"
40 color: qgcPal.textPrimary
41 fillMode: Image.PreserveAspectFit
42 sourceSize.height: height
46 Layout.fillWidth: true
47 elide: Text.ElideRight
49 switch (row.modelData.kind) {
51 return qsTr("Polygon %1").arg(row.modelData.index + 1)
53 return qsTr("Circle %1").arg(row.modelData.index + 1)
55 return qsTr("Breach return point")
60 objectName: "planPanel_fenceRowMeta"
61 color: qgcPal.textSecondary
62 font.pointSize: ScreenTools.smallFontPointSize
64 if (row.modelData.kind === "breach") {
65 return root.page.controller.breachReturnPoint.isValid ? qsTr("Set") : qsTr("Not set")
70 const inclusion = row.fence.inclusion ? qsTr("Include") : qsTr("Exclude")
71 if (row.modelData.kind === "circle") {
72 return qsTr("%1 %2, %3").arg(row.fence.radius.valueString).arg(row.fence.radius.units).arg(inclusion)
79 QGCPalette { id: qgcPal }