Unverified Commit 1c68e56f authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8002 from DonLakeFlyer/PlanIncompleteVisuals

Plan: Incomplete visuals, Polygon/line toolbar
parents 2af2cd31 290450ef
...@@ -516,10 +516,11 @@ Item { ...@@ -516,10 +516,11 @@ Item {
id: toolbarComponent id: toolbarComponent
PlanEditToolbar { PlanEditToolbar {
x: mapControl.centerViewport.left anchors.horizontalCenter: mapControl.left
y: mapControl.centerViewport.top anchors.horizontalCenterOffset: mapControl.centerViewport.left + (mapControl.centerViewport.width / 2)
width: mapControl.centerViewport.width y: mapControl.centerViewport.top
z: QGroundControl.zOrderMapItems + 2 z: QGroundControl.zOrderMapItems + 2
availableWidth: mapControl.centerViewport.width
QGCButton { QGCButton {
_horizontalPadding: 0 _horizontalPadding: 0
......
...@@ -314,10 +314,11 @@ Item { ...@@ -314,10 +314,11 @@ Item {
id: toolbarComponent id: toolbarComponent
PlanEditToolbar { PlanEditToolbar {
x: mapControl.centerViewport.left anchors.horizontalCenter: mapControl.left
y: mapControl.centerViewport.top anchors.horizontalCenterOffset: mapControl.centerViewport.left + (mapControl.centerViewport.width / 2)
width: mapControl.centerViewport.width y: mapControl.centerViewport.top
z: QGroundControl.zOrderMapItems + 2 z: QGroundControl.zOrderMapItems + 2
availableWidth: mapControl.centerViewport.width
QGCButton { QGCButton {
_horizontalPadding: 0 _horizontalPadding: 0
......
...@@ -14,11 +14,13 @@ import QGroundControl.Palette 1.0 ...@@ -14,11 +14,13 @@ import QGroundControl.Palette 1.0
/// Mission item edit control /// Mission item edit control
Rectangle { Rectangle {
id: _root id: _root
height: editorLoader.visible ? (editorLoader.y + editorLoader.height + (_margin * 2)) : (commandPicker.y + commandPicker.height + _margin / 2) height: editorLoader.visible ? (editorLoader.y + editorLoader.height + (_margin * 2)) : (commandPicker.y + commandPicker.height + _margin / 2)
color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade
radius: _radius radius: _radius
opacity: _currentItem ? 1.0 : 0.7 opacity: _currentItem ? 1.0 : 0.7
border.width: _readyForSave ? 0 : 1
border.color: qgcPal.warningText
property var map ///< Map control property var map ///< Map control
property var masterController property var masterController
...@@ -38,6 +40,7 @@ Rectangle { ...@@ -38,6 +40,7 @@ Rectangle {
property bool _noMissionItemsAdded: ListView.view.model.count === 1 property bool _noMissionItemsAdded: ListView.view.model.count === 1
property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings
property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1
property bool _readyForSave: missionItem.readyForSaveState === VisualMissionItem.ReadyForSave
readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12) readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12)
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
...@@ -73,27 +76,43 @@ Rectangle { ...@@ -73,27 +76,43 @@ Rectangle {
} }
Rectangle { Rectangle {
anchors.verticalCenter: commandPicker.verticalCenter id: notReadyForSaveIndicator
anchors.verticalCenter: notReadyForSaveLabel.visible ? notReadyForSaveLabel.verticalCenter : commandPicker.verticalCenter
anchors.leftMargin: _margin anchors.leftMargin: _margin
anchors.left: parent.left anchors.left: parent.left
width: readyForSaveLabel.contentHeight width: readyForSaveLabel.contentHeight
height: width height: width
border.width: 1 border.width: 1
border.color: "red" border.color: qgcPal.warningText
color: "white" color: "white"
radius: width / 2 radius: width / 2
visible: missionItem.readyForSaveState !== VisualMissionItem.ReadyForSave visible: !_readyForSave
QGCLabel { QGCLabel {
id: readyForSaveLabel id: readyForSaveLabel
anchors.centerIn: parent anchors.centerIn: parent
//: Indicator in Plan view to show mission item is not ready for save/send //: Indicator in Plan view to show mission item is not ready for save/send
text: qsTr("?") text: qsTr("?")
color: "red" color: qgcPal.warningText
font.pointSize: ScreenTools.smallFontPointSize font.pointSize: ScreenTools.smallFontPointSize
} }
} }
QGCLabel {
id: notReadyForSaveLabel
anchors.margins: _margin
anchors.left: notReadyForSaveIndicator.right
anchors.right: parent.right
anchors.top: commandPicker.bottom
visible: _currentItem && !_readyForSave
text: missionItem.readyForSaveState === VisualMissionItem.NotReadyForSaveTerrain ?
qsTr("Incomplete: Waiting on terrain data.") :
qsTr("Incomplete: Item not fully specified.")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
color: qgcPal.warningText
}
QGCColoredImage { QGCColoredImage {
id: hamburger id: hamburger
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
...@@ -197,18 +216,10 @@ Rectangle { ...@@ -197,18 +216,10 @@ Rectangle {
QGCButton { QGCButton {
id: commandPicker id: commandPicker
anchors.topMargin: _margin / 2 anchors.topMargin: _margin
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.leftMargin: _margin anchors.leftMargin: _margin
anchors.left: parent.left anchors.left: parent.left
/*
Trying no sequence numbers in ui
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.left: label.right
*/
anchors.top: parent.top anchors.top: parent.top
visible: !commandLabel.visible visible: !commandLabel.visible
text: missionItem.commandName text: missionItem.commandName
...@@ -237,10 +248,9 @@ Rectangle { ...@@ -237,10 +248,9 @@ Rectangle {
Loader { Loader {
id: editorLoader id: editorLoader
anchors.leftMargin: _margin anchors.margins: _margin
anchors.topMargin: _margin
anchors.left: parent.left anchors.left: parent.left
anchors.top: commandPicker.bottom anchors.top: _readyForSave ? commandPicker.bottom : notReadyForSaveLabel.bottom
source: missionItem.editorQml source: missionItem.editorQml
visible: _currentItem visible: _currentItem
......
...@@ -14,14 +14,18 @@ import QtQuick.Layouts 1.2 ...@@ -14,14 +14,18 @@ import QtQuick.Layouts 1.2
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
/// Toolbar used for things like Polygon editing tools /// Toolbar used for things like Polygon editing tools
Item { Item {
width: Math.min(toolsRowLayout.width + (_margins * 2), availableWidth)
height: toolsFlickable.y + toolsFlickable.height + _margins height: toolsFlickable.y + toolsFlickable.height + _margins
z: QGroundControl.zOrderMapItems + 2 z: QGroundControl.zOrderMapItems + 2
property real _radius: ScreenTools.defaultFontPixelWidth / 2 property real availableWidth
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _radius: ScreenTools.defaultFontPixelWidth / 2
property real _margins: ScreenTools.defaultFontPixelWidth / 2
Component.onCompleted: { Component.onCompleted: {
// Move the child controls from consumer into the layout control // Move the child controls from consumer into the layout control
...@@ -39,8 +43,7 @@ Item { ...@@ -39,8 +43,7 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
radius: _radius radius: _radius
color: "white" color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark
opacity: 0.75
} }
QGCFlickable { QGCFlickable {
...@@ -64,10 +67,8 @@ Item { ...@@ -64,10 +67,8 @@ Item {
id: instructionComponent id: instructionComponent
QGCLabel { QGCLabel {
id: instructionLabel id: instructionLabel
color: "black" text: _instructionText
text: _instructionText
Layout.fillWidth: true
} }
} }
} }
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