Browse Source

Use new SplitIndicator control

QGC4.4
Don Gagne 6 years ago
parent
commit
2e6ab5ddad
  1. 1
      src/FlightMap/MapItems/SplitIndicator.qml
  2. 26
      src/MissionManager/QGCMapPolygonVisuals.qml
  3. 30
      src/MissionManager/QGCMapPolylineVisuals.qml
  4. 4
      src/PlanView/CorridorScanMapVisual.qml
  5. 2
      src/PlanView/SurveyMapVisual.qml
  6. 5
      src/PlanView/TransectStyleMapVisuals.qml

1
src/FlightMap/MapItems/SplitIndicator.qml

@ -20,6 +20,7 @@ Rectangle {
radius: width / 2 radius: width / 2
border.color: indicatorColor border.color: indicatorColor
color: "transparent" color: "transparent"
opacity: 0.75
property color indicatorColor: "white" property color indicatorColor: "white"

26
src/MissionManager/QGCMapPolygonVisuals.qml

@ -267,32 +267,14 @@ Item {
MapQuickItem { MapQuickItem {
id: mapQuickItem id: mapQuickItem
anchorPoint.x: dragHandle.width / 2 anchorPoint.x: sourceItem.width / 2
anchorPoint.y: dragHandle.height / 2 anchorPoint.y: sourceItem.height / 2
visible: !_circle visible: !_circle
property int vertexIndex property int vertexIndex
sourceItem: Rectangle { sourceItem: SplitIndicator {
id: dragHandle z: _zorderSplitHandle
width: ScreenTools.defaultFontPixelHeight * 1.5
height: width
radius: width / 2
border.color: "white"
color: "transparent"
opacity: .50
z: _zorderSplitHandle
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
text: "+"
}
QGCMouseArea {
fillItem: parent
onClicked: mapPolygon.splitPolygonSegment(mapQuickItem.vertexIndex)
}
} }
} }
} }

30
src/MissionManager/QGCMapPolylineVisuals.qml

@ -98,8 +98,6 @@ Item {
} }
} }
onVisibleChanged: _polylineComponent.visible = visible
Component.onCompleted: { Component.onCompleted: {
addVisuals() addVisuals()
if (interactive) { if (interactive) {
@ -175,6 +173,7 @@ Item {
line.width: lineWidth line.width: lineWidth
line.color: lineColor line.color: lineColor
path: mapPolyline.path path: mapPolyline.path
visible: _root.visible
} }
} }
@ -183,31 +182,14 @@ Item {
MapQuickItem { MapQuickItem {
id: mapQuickItem id: mapQuickItem
anchorPoint.x: splitHandle.width / 2 anchorPoint.x: sourceItem.width / 2
anchorPoint.y: splitHandle.height / 2 anchorPoint.y: sourceItem.height / 2
z: _zorderSplitHandle
property int vertexIndex property int vertexIndex
sourceItem: Rectangle { sourceItem: SplitIndicator {
id: splitHandle onClicked: mapPolyline.splitSegment(mapQuickItem.vertexIndex)
width: ScreenTools.defaultFontPixelHeight * 1.5
height: width
radius: width / 2
border.color: "white"
color: "transparent"
opacity: .50
z: _zorderSplitHandle
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
text: "+"
}
QGCMouseArea {
fillItem: parent
onClicked: mapPolyline.splitSegment(mapQuickItem.vertexIndex)
}
} }
} }
} }

4
src/PlanView/CorridorScanMapVisual.qml

@ -17,7 +17,9 @@ import QGroundControl.Controls 1.0
/// Corridor Scan Complex Mission Item visuals /// Corridor Scan Complex Mission Item visuals
TransectStyleMapVisuals { TransectStyleMapVisuals {
property bool _currentItem: object.isCurrentItem polygonInteractive: false
property bool _currentItem: object.isCurrentItem
Component.onCompleted: mapPolylineVisuals.addInitialPolyline() Component.onCompleted: mapPolylineVisuals.addInitialPolyline()

2
src/PlanView/SurveyMapVisual.qml

@ -20,6 +20,8 @@ import QGroundControl.FlightMap 1.0
/// Survey Complex Mission Item visuals /// Survey Complex Mission Item visuals
TransectStyleMapVisuals { TransectStyleMapVisuals {
polygonInteractive: true
property var _mapPolygon: object.surveyAreaPolygon property var _mapPolygon: object.surveyAreaPolygon
/// Add an initial 4 sided polygon if there is none /// Add an initial 4 sided polygon if there is none

5
src/PlanView/TransectStyleMapVisuals.qml

@ -22,7 +22,8 @@ import QGroundControl.FlightMap 1.0
Item { Item {
id: _root id: _root
property var map ///< Map control to place item in property var map ///< Map control to place item in
property bool polygonInteractive: true
property var _missionItem: object property var _missionItem: object
property var _mapPolygon: object.surveyAreaPolygon property var _mapPolygon: object.surveyAreaPolygon
@ -69,7 +70,7 @@ Item {
id: mapPolygonVisuals id: mapPolygonVisuals
mapControl: map mapControl: map
mapPolygon: _mapPolygon mapPolygon: _mapPolygon
interactive: _missionItem.isCurrentItem interactive: polygonInteractive && _missionItem.isCurrentItem
borderWidth: 1 borderWidth: 1
borderColor: "black" borderColor: "black"
interiorColor: "green" interiorColor: "green"

Loading…
Cancel
Save