Commit f63b0db6 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #5105 from DonLakeFlyer/RallyPointDrag

Rally point drag
parents 05ad4627 f8c906c0
......@@ -30,7 +30,7 @@ QGCFlickable {
width: parent.width
height: geoFenceItems.y + geoFenceItems.height + (_margin * 2)
radius: _radius
color: qgcPal.buttonHighlight
color: qgcPal.missionItemEditor
QGCLabel {
id: geoFenceLabel
......
......@@ -20,7 +20,7 @@ QGCFlickable {
width: parent.width
height: innerEditorRect.y + innerEditorRect.height + (_margin * 2)
radius: _radius
color: qgcPal.buttonHighlight
color: qgcPal.missionItemEditor
QGCLabel {
id: editorLabel
......
......@@ -11,7 +11,7 @@ import QGroundControl.Palette 1.0
Rectangle {
id: root
height: _currentItem ? valuesRect.y + valuesRect.height + (_margin * 2) : titleBar.y - titleBar.height + _margin
color: _currentItem ? qgcPal.buttonHighlight : qgcPal.windowShade
color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade
radius: _radius
property var rallyPoint ///< RallyPoint object associated with editor
......
......@@ -40,6 +40,19 @@ Item {
_rallyPointsComponent.destroy()
}
Component {
id: dragAreaComponent
MissionItemIndicatorDrag {
itemCoordinate: rallyPointObject.coordinate
visible: rallyPointObject == myRallyPointController.currentRallyPoint
property var rallyPointObject
onItemCoordinateChanged: rallyPointObject.coordinate = itemCoordinate
}
}
Component {
id: rallyPointComponent
......@@ -72,17 +85,14 @@ Item {
property var _visuals: [ ]
Component.onCompleted: {
var rallyPoint = rallyPointComponent.createObject(map)
rallyPoint.coordinate = Qt.binding(function() { return object.coordinate })
rallyPoint.rallyPointObject = Qt.binding(function() { return object })
map.addMapItem(rallyPoint)
_visuals.push(rallyPoint)
/*
var dragArea = dragAreaComponent.createObject(map, { "itemIndicator": dragHandle, "itemCoordinate": object.coordinate })
dragArea.polygonVertex = Qt.binding(function() { return index })
_visuals.push(dragHandle)
var rallyPointIndicator = rallyPointComponent.createObject(map)
rallyPointIndicator.coordinate = Qt.binding(function() { return object.coordinate })
rallyPointIndicator.rallyPointObject = Qt.binding(function() { return object })
map.addMapItem(rallyPointIndicator)
_visuals.push(rallyPointIndicator)
var dragArea = dragAreaComponent.createObject(map, { "itemIndicator": rallyPointIndicator, "rallyPointObject": object })
_visuals.push(dragArea)
*/
}
Component.onDestruction: {
......
......@@ -6,11 +6,10 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
RadioButton {
property var color: qgcPal.text ///< Text color
property int textStyle: Text.Normal
property color textStyleColor: qgcPal.text
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
property var color: qgcPal.text ///< Text color
property int textStyle: Text.Normal
property color textStyleColor: qgcPal.text
property var qgcPal: QGCPalette { colorGroupEnabled: enabled }
style: RadioButtonStyle {
label: Item {
......@@ -47,7 +46,8 @@ RadioButton {
indicator: Rectangle {
width: ScreenTools.radioButtonIndicatorSize
height: width
border.color: qgcPal.text
color: "white"
border.color: control.qgcPal.text
antialiasing: true
radius: height / 2
......@@ -56,8 +56,8 @@ RadioButton {
width: Math.round(parent.width * 0.5)
height: width
antialiasing: true
radius: height/2
color: qgcPal.text
radius: height / 2
color: "black"
opacity: control.checked ? (control.enabled ? 1 : 0.5) : 0
}
}
......
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