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