6import QGroundControl.Controls
9 required property var editorMap
10 required property var planMasterController
12 signal editingLayerChangeRequested(int layer)
16 property var _missionController: planMasterController.missionController
17 property real _toolsMargin: ScreenTools.defaultFontPixelWidth * 0.75
19 property bool useNewPlanPanel: QGroundControl.settingsManager.planViewSettings.useNewPlanPanel.rawValue
21 readonly property bool _useNewPlanPanel: useNewPlanPanel
23 function selectNextNotReady() {
24 for (var i = 0; i < _missionController.visualItems.count; i++) {
25 var vmi = _missionController.visualItems.get(i)
26 if (vmi.readyForSaveState === VisualMissionItem.NotReadyForSaveData) {
27 _missionController.setCurrentPlanViewSeqNum(vmi.sequenceNumber, true)
33 QGCPalette { id: qgcPal }
36 id: rightPanelBackground
40 visible: !root._useNewPlanPanel
46 id: panelOpenCloseButton
47 anchors.right: parent.left
48 anchors.verticalCenter: parent.verticalCenter
49 // The tabbed panel has its tab pills at the top of this edge so the button moves to the bottom
50 anchors.verticalCenterOffset: root._useNewPlanPanel ? parent.height / 2 - height / 2 - _toolsMargin : 0
51 width: toggleButtonRect.width - toggleButtonRect.radius * (root._useNewPlanPanel ? 2 : 1)
52 height: toggleButtonRect.height
55 property bool _expanded: root.anchors.right == root.parent.right
59 // The tabbed panel styles the button like its tab pills, with the inner side tucked under the panel
60 width: root._useNewPlanPanel ? ScreenTools.defaultFontPixelHeight * 2.2 : ScreenTools.defaultFontPixelWidth * 2.25
61 height: root._useNewPlanPanel ? ScreenTools.defaultFontPixelHeight * 2.2 : width * 3
62 radius: ScreenTools.defaultBorderRadius
63 color: root._useNewPlanPanel ? qgcPal.windowPanel : rightPanelBackground.color
64 opacity: root._useNewPlanPanel ? 1 : rightPanelBackground.opacity
65 border.width: root._useNewPlanPanel ? 1 : 0
66 border.color: qgcPal.borderSubtle
70 anchors.centerIn: parent
71 anchors.horizontalCenterOffset: root._useNewPlanPanel ? -toggleButtonRect.radius : 0
72 text: panelOpenCloseButton._expanded ? ">" : "<"
73 color: qgcPal.textPrimary
82 if (panelOpenCloseButton._expanded) {
84 root.anchors.right = undefined
85 root.anchors.left = root.parent.right
88 root.anchors.left = undefined
89 root.anchors.right = root.parent.right
95 //-------------------------------------------------------
96 // Right Panel Controls
98 anchors.fill: rightPanelBackground
107 active: !root._useNewPlanPanel
109 sourceComponent: PlanTreeView {
110 objectName: "planView_planTree"
111 editorMap: root.editorMap
112 planMasterController: root.planMasterController
113 onEditingLayerChangeRequested: (layer) => root.editingLayerChangeRequested(layer)
120 active: root._useNewPlanPanel
122 sourceComponent: PlanPanel {
123 editorMap: root.editorMap
124 planMasterController: root.planMasterController
125 onEditingLayerChangeRequested: (layer) => root.editingLayerChangeRequested(layer)
130 /// Called when the user picks a mission item on the map
131 function showItemInspector() {
132 if (planPanelLoader.item) {
133 planPanelLoader.item.showItemInspector()
137 function selectLayer(nodeType) {
138 // Ensure panel is open
139 if (!panelOpenCloseButton._expanded) {
140 root.anchors.left = undefined
141 root.anchors.right = root.parent.right
143 if (planPanelLoader.item) {
144 planPanelLoader.item.selectLayer(nodeType)
145 } else if (planTreeLoader.item) {
146 planTreeLoader.item.selectLayer(nodeType)