Commit e7c3fda4 authored by Don Gagne's avatar Don Gagne

parent 8d325b21
...@@ -32,7 +32,7 @@ MapQuickItem { ...@@ -32,7 +32,7 @@ MapQuickItem {
id: _label id: _label
checked: _isCurrentItem checked: _isCurrentItem
label: missionItem ? missionItem.abbreviation : "" label: missionItem ? missionItem.abbreviation : ""
index: missionItem ? missionItem.sequenceNumber : 0 //index: missionItem ? missionItem.sequenceNumber : 0
gimbalYaw: missionItem.missionGimbalYaw gimbalYaw: missionItem.missionGimbalYaw
vehicleYaw: missionItem.missionVehicleYaw vehicleYaw: missionItem.missionVehicleYaw
showGimbalYaw: !isNaN(missionItem.missionGimbalYaw) showGimbalYaw: !isNaN(missionItem.missionGimbalYaw)
......
...@@ -2112,6 +2112,7 @@ VisualMissionItem* MissionController::currentPlanViewItem(void) const ...@@ -2112,6 +2112,7 @@ VisualMissionItem* MissionController::currentPlanViewItem(void) const
void MissionController::setCurrentPlanViewIndex(int sequenceNumber, bool force) void MissionController::setCurrentPlanViewIndex(int sequenceNumber, bool force)
{ {
qDebug() << "setCurrentPlanViewIndex" << sequenceNumber << force << _currentPlanViewIndex;
if(_visualItems && (force || sequenceNumber != _currentPlanViewIndex)) { if(_visualItems && (force || sequenceNumber != _currentPlanViewIndex)) {
_splitSegment = nullptr; _splitSegment = nullptr;
_currentPlanViewItem = nullptr; _currentPlanViewItem = nullptr;
......
...@@ -105,7 +105,7 @@ Item { ...@@ -105,7 +105,7 @@ Item {
MissionItemIndicator { MissionItemIndicator {
coordinate: _missionItem.coordinate coordinate: _missionItem.coordinate
visible: _missionItem.specifiesCoordinate && (_missionItem.abbreviation != "" || map.planView || _missionItem.isCurrentItem || (vehicle.flightMode === vehicle.pauseFlightMode && vehicle.armed)) visible: _missionItem.specifiesCoordinate
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
missionItem: _missionItem missionItem: _missionItem
sequenceNumber: _missionItem.sequenceNumber sequenceNumber: _missionItem.sequenceNumber
......
...@@ -15,7 +15,7 @@ Canvas { ...@@ -15,7 +15,7 @@ Canvas {
property string label ///< Label to show to the side of the index indicator property string label ///< Label to show to the side of the index indicator
property int index: 0 ///< Index to show in the indicator, 0 will show single char label instead, -1 first char of label in indicator full label to the side property int index: 0 ///< Index to show in the indicator, 0 will show single char label instead, -1 first char of label in indicator full label to the side
property bool checked: false property bool checked: false
property bool small: false property bool small: !checked
property bool child: false property bool child: false
property bool highlightSelected: false property bool highlightSelected: false
property var color: checked ? "green" : (child ? qgcPal.mapIndicatorChild : qgcPal.mapIndicator) property var color: checked ? "green" : (child ? qgcPal.mapIndicatorChild : qgcPal.mapIndicator)
...@@ -30,12 +30,14 @@ Canvas { ...@@ -30,12 +30,14 @@ Canvas {
property real _height: showGimbalYaw ? _gimbalYawWidth : (labelControl.visible ? labelControl.height : indicator.height) property real _height: showGimbalYaw ? _gimbalYawWidth : (labelControl.visible ? labelControl.height : indicator.height)
property real _gimbalYawRadius: ScreenTools.defaultFontPixelHeight property real _gimbalYawRadius: ScreenTools.defaultFontPixelHeight
property real _gimbalYawWidth: _gimbalYawRadius * 2 property real _gimbalYawWidth: _gimbalYawRadius * 2
property real _indicatorRadius: small ? (ScreenTools.defaultFontPixelHeight * ScreenTools.smallFontPointRatio * 1.25 / 2) : (ScreenTools.defaultFontPixelHeight * 0.66) property real _smallRadius: (ScreenTools.defaultFontPixelHeight * ScreenTools.smallFontPointRatio) / 2
property real _normalRadius: ScreenTools.defaultFontPixelHeight * 0.66
property real _indicatorRadius: small ? _smallRadius : _normalRadius
property real _gimbalRadians: degreesToRadians(vehicleYaw + gimbalYaw - 90) property real _gimbalRadians: degreesToRadians(vehicleYaw + gimbalYaw - 90)
property real _labelMargin: 2 property real _labelMargin: 2
property real _labelRadius: _indicatorRadius + _labelMargin property real _labelRadius: _indicatorRadius + _labelMargin
property string _label: label.length > 1 ? label : "" property string _label: label.length > 1 ? label : ""
property string _index: index === 0 || index === -1 ? label.charAt(0) : ""/*index*/ property string _index: index === 0 || index === -1 ? label.charAt(0) : "" /*index*/
onColorChanged: requestPaint() onColorChanged: requestPaint()
onShowGimbalYawChanged: requestPaint() onShowGimbalYawChanged: requestPaint()
...@@ -68,6 +70,8 @@ Canvas { ...@@ -68,6 +70,8 @@ Canvas {
paintGimbalYaw(context) paintGimbalYaw(context)
} }
Behavior on _indicatorRadius { PropertyAnimation {} }
Rectangle { Rectangle {
id: labelControl id: labelControl
anchors.leftMargin: -((_labelMargin * 2) + indicator.width) anchors.leftMargin: -((_labelMargin * 2) + indicator.width)
...@@ -115,6 +119,7 @@ Canvas { ...@@ -115,6 +119,7 @@ Canvas {
} }
} }
// Extra circle to indicate selection
Rectangle { Rectangle {
width: indicator.width * 2 width: indicator.width * 2
height: width height: width
...@@ -126,8 +131,15 @@ Canvas { ...@@ -126,8 +131,15 @@ Canvas {
anchors.centerIn: indicator anchors.centerIn: indicator
} }
// The mouse click area is always the size of a normal indicator
Item {
id: mouseAreaFill
anchors.margins: small ? -(_normalRadius - _smallRadius) : 0
anchors.fill: indicator
}
QGCMouseArea { QGCMouseArea {
fillItem: parent fillItem: mouseAreaFill
onClicked: { onClicked: {
focus = true focus = true
parent.clicked() parent.clicked()
......
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