diff --git a/src/GUI/GettingStartedTip.hxx b/src/GUI/GettingStartedTip.hxx index 4ea540b59..096c41249 100644 --- a/src/GUI/GettingStartedTip.hxx +++ b/src/GUI/GettingStartedTip.hxx @@ -35,6 +35,7 @@ public: TopRight, TopLeft, LeftTop, // on the left side, at the top + NoArrow }; Q_ENUM(Arrow) diff --git a/src/GUI/GettingStartedTipsController.cxx b/src/GUI/GettingStartedTipsController.cxx index a1418b5d5..d2e8fe6b6 100755 --- a/src/GUI/GettingStartedTipsController.cxx +++ b/src/GUI/GettingStartedTipsController.cxx @@ -43,6 +43,7 @@ static std::initializer_list static_tipGeometries = {GettingStartedTip::Arrow::LeftCenter, QRectF{0.0, 0.0, tipBoxWidth, dummyHeight}, Qt::AlignVCenter}, {GettingStartedTip::Arrow::RightCenter, QRectF{-(tipBoxWidth + TipBackgroundBox::arrowHeight()), 0.0, tipBoxWidth, dummyHeight}, Qt::AlignVCenter}, {GettingStartedTip::Arrow::LeftTop, QRectF{0.0, topHeightOffset, tipBoxWidth, dummyHeight}, Qt::AlignTop}, + {GettingStartedTip::Arrow::NoArrow, QRectF{-halfBoxWidth, 0.0, tipBoxWidth, dummyHeight}, Qt::AlignVCenter}, }; @@ -338,14 +339,16 @@ QRectF GettingStartedTipsController::tipGeometry() const } QRectF g = it->geometry; - if ((arrow == GettingStartedTip::Arrow::LeftCenter) || (arrow == GettingStartedTip::Arrow::RightCenter) - || (arrow == GettingStartedTip::Arrow::LeftTop)) { + if ((arrow == GettingStartedTip::Arrow::LeftCenter) + || (arrow == GettingStartedTip::Arrow::RightCenter) + || (arrow == GettingStartedTip::Arrow::LeftTop) + || (arrow == GettingStartedTip::Arrow::NoArrow)) + { g.setHeight(_activeTipHeight); } else { g.setHeight(_activeTipHeight + TipBackgroundBox::arrowHeight()); } - switch (it->verticalAlignment) { case Qt::AlignBottom: g.moveBottom(0); diff --git a/src/GUI/TipBackgroundBox.cxx b/src/GUI/TipBackgroundBox.cxx index 843e382ad..1d6bea932 100644 --- a/src/GUI/TipBackgroundBox.cxx +++ b/src/GUI/TipBackgroundBox.cxx @@ -97,6 +97,15 @@ QPainterPath pathFromArrowAndGeometry(GettingStartedTip::Arrow arrow, const QRec pp.closeSubpath(); break; + case GettingStartedTip::Arrow::NoArrow: + pp.moveTo(0.0, g.top()); + pp.lineTo(g.right(), g.top()); + pp.lineTo(g.right(), g.bottom()); + pp.lineTo(0.0, g.bottom()); + pp.closeSubpath(); + break; + + default: qWarning() << Q_FUNC_INFO << "unhandled:" << arrow; break; diff --git a/src/GUI/qml/LocationAirportView.qml b/src/GUI/qml/LocationAirportView.qml index 152662fd6..646d3b7f5 100644 --- a/src/GUI/qml/LocationAirportView.qml +++ b/src/GUI/qml/LocationAirportView.qml @@ -12,6 +12,8 @@ Item { onGuidChanged: _location.setBaseLocation(this) } + GettingStartedScope.controller: tips.controller + readonly property bool isHeliport: airportData.type === Positioned.Heliport readonly property bool haveParking: airportData.airportHasParkings @@ -37,6 +39,13 @@ Item { approachExtensionEnabled: _location.onFinal approachExtension: _location.offsetDistance + + GettingStartedTip { + tipId: "locationDiagram" + anchors.centerIn: parent + arrow: GettingStartedTip.NoArrow + text: qsTr("Click here to select a runway or parking position, and drag to pan. Mouse-wheel zooms in and out.") + } } // not very declarative, try to remove this over time @@ -383,4 +392,10 @@ Item { } // main layout column } // main panel rectangle + + GettingStartedTipLayer { + id: tips + anchors.fill: parent + scopeId: "locationAirportDetails" + } } diff --git a/src/GUI/qml/LocationNavaidView.qml b/src/GUI/qml/LocationNavaidView.qml index 8e257a9b8..38486fde0 100644 --- a/src/GUI/qml/LocationNavaidView.qml +++ b/src/GUI/qml/LocationNavaidView.qml @@ -17,6 +17,8 @@ Item { } } + GettingStartedScope.controller: tips.controller + NavaidDiagram { id: diagram anchors.fill: parent @@ -25,6 +27,13 @@ Item { offsetBearing: _location.offsetRadial offsetDistance: _location.offsetDistance heading: _location.heading + + GettingStartedTip { + tipId: "locationNavDiagram" + anchors.centerIn: parent + arrow: GettingStartedTip.NoArrow + text: qsTr("Drag here to move the map. Mouse-wheel zooms in and out.") + } } Rectangle { @@ -158,4 +167,11 @@ Item { } } // main layout column } // main panel rectangle + + + GettingStartedTipLayer { + id: tips + anchors.fill: parent + scopeId: "locationNavDetails" + } }