Commit e7c3fda4 authored by Don Gagne's avatar Don Gagne

parent 8d325b21
......@@ -32,7 +32,7 @@ MapQuickItem {
id: _label
checked: _isCurrentItem
label: missionItem ? missionItem.abbreviation : ""
index: missionItem ? missionItem.sequenceNumber : 0
//index: missionItem ? missionItem.sequenceNumber : 0
gimbalYaw: missionItem.missionGimbalYaw
vehicleYaw: missionItem.missionVehicleYaw
showGimbalYaw: !isNaN(missionItem.missionGimbalYaw)
......
......@@ -2112,6 +2112,7 @@ VisualMissionItem* MissionController::currentPlanViewItem(void) const
void MissionController::setCurrentPlanViewIndex(int sequenceNumber, bool force)
{
qDebug() << "setCurrentPlanViewIndex" << sequenceNumber << force << _currentPlanViewIndex;
if(_visualItems && (force || sequenceNumber != _currentPlanViewIndex)) {
_splitSegment = nullptr;
_currentPlanViewItem = nullptr;
......
......@@ -105,7 +105,7 @@ Item {
MissionItemIndicator {
coordinate: _missionItem.coordinate
visible: _missionItem.specifiesCoordinate && (_missionItem.abbreviation != "" || map.planView || _missionItem.isCurrentItem || (vehicle.flightMode === vehicle.pauseFlightMode && vehicle.armed))
visible: _missionItem.specifiesCoordinate
z: QGroundControl.zOrderMapItems
missionItem: _missionItem
sequenceNumber: _missionItem.sequenceNumber
......
......@@ -15,7 +15,7 @@ Canvas {
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 bool checked: false
property bool small: false
property bool small: !checked
property bool child: false
property bool highlightSelected: false
property var color: checked ? "green" : (child ? qgcPal.mapIndicatorChild : qgcPal.mapIndicator)
......@@ -30,12 +30,14 @@ Canvas {
property real _height: showGimbalYaw ? _gimbalYawWidth : (labelControl.visible ? labelControl.height : indicator.height)
property real _gimbalYawRadius: ScreenTools.defaultFontPixelHeight
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 _labelMargin: 2
property real _labelRadius: _indicatorRadius + _labelMargin
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()
onShowGimbalYawChanged: requestPaint()
......@@ -68,6 +70,8 @@ Canvas {
paintGimbalYaw(context)
}
Behavior on _indicatorRadius { PropertyAnimation {} }
Rectangle {
id: labelControl
anchors.leftMargin: -((_labelMargin * 2) + indicator.width)
......@@ -115,6 +119,7 @@ Canvas {
}
}
// Extra circle to indicate selection
Rectangle {
width: indicator.width * 2
height: width
......@@ -126,8 +131,15 @@ Canvas {
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 {
fillItem: parent
fillItem: mouseAreaFill
onClicked: {
focus = true
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