Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6762622d
Unverified
Commit
6762622d
authored
Mar 16, 2020
by
Don Gagne
Committed by
GitHub
Mar 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8552 from DonLakeFlyer/PlanViewTweals
Plan: Visual tweaks for mission items
parents
860915f7
edd8f9d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
184 additions
and
198 deletions
+184
-198
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+169
-166
PlanView.qml
src/PlanView/PlanView.qml
+15
-32
No files found.
src/PlanView/MissionItemEditor.qml
View file @
6762622d
...
...
@@ -16,7 +16,7 @@ import QGroundControl.Palette 1.0
/// Mission item edit control
Rectangle
{
id
:
_root
height
:
editorLoader
.
visible
?
(
editorLoader
.
y
+
editorLoader
.
height
+
(
_margin
*
2
))
:
(
commandPicker
.
y
+
commandPicker
.
height
+
_margin
/
2
)
height
:
editorLoader
.
visible
?
(
editorLoader
.
y
+
editorLoader
.
height
+
_innerMargin
)
:
(
topRowLayout
.
y
+
topRowLayout
.
height
+
_margin
)
color
:
_currentItem
?
qgcPal
.
missionItemEditor
:
qgcPal
.
windowShade
radius
:
_radius
opacity
:
_currentItem
?
1.0
:
0.7
...
...
@@ -42,8 +42,9 @@ Rectangle {
property
bool
_readyForSave
:
missionItem
.
readyForSaveState
===
VisualMissionItem
.
ReadyForSave
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_
m
argin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_
innerM
argin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_innerMargin
:
2
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_hamburgerSize
:
commandPicker
.
height
*
0.75
readonly
property
real
_trashSize
:
commandPicker
.
height
*
0.75
...
...
@@ -76,11 +77,17 @@ Rectangle {
}
}
Row
{
id
:
topRowLayout
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
spacing
:
_margin
Rectangle
{
id
:
notReadyForSaveIndicator
anchors.verticalCenter
:
notReadyForSaveLabel
.
visible
?
notReadyForSaveLabel
.
verticalCenter
:
commandPicker
.
verticalCenter
anchors.leftMargin
:
_margin
anchors.left
:
parent
.
left
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
readyForSaveLabel
.
contentHeight
height
:
width
border.width
:
1
...
...
@@ -99,37 +106,97 @@ Rectangle {
}
}
QGCColoredImage
{
id
:
deleteButton
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
_hamburgerSize
width
:
height
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
color
:
qgcPal
.
text
visible
:
_currentItem
&&
missionItem
.
sequenceNumber
!==
0
source
:
"
/res/TrashDelete.svg
"
QGCMouseArea
{
fillItem
:
parent
onClicked
:
remove
()
}
}
Item
{
id
:
commandPicker
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
ScreenTools
.
implicitComboBoxHeight
width
:
innerLayout
.
width
visible
:
!
commandLabel
.
visible
RowLayout
{
id
:
innerLayout
anchors.verticalCenter
:
parent
.
verticalCenter
spacing
:
_padding
property
real
_padding
:
ScreenTools
.
comboBoxPadding
QGCLabel
{
text
:
missionItem
.
commandName
}
QGCColoredImage
{
height
:
ScreenTools
.
defaultFontPixelWidth
width
:
height
fillMode
:
Image
.
PreserveAspectFit
smooth
:
true
antialiasing
:
true
color
:
qgcPal
.
text
source
:
"
/qmlimages/arrow-down.png
"
}
}
QGCMouseArea
{
fillItem
:
parent
onClicked
:
mainWindow
.
showComponentDialog
(
commandDialog
,
qsTr
(
"
Select Mission Command
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
Component
{
id
:
commandDialog
MissionCommandDialog
{
missionItem
:
_root
.
missionItem
map
:
_root
.
map
// FIXME: Disabling fly through commands doesn't work since you may need to change from an RTL to something else
flyThroughCommandsAllowed
:
true
//_missionController.flyThroughCommandsAllowed
}
}
}
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
id
:
commandLabel
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
commandPicker
.
width
height
:
commandPicker
.
height
visible
:
!
missionItem
.
isCurrentItem
||
!
missionItem
.
isSimpleItem
||
_waypointsOnlyMode
||
missionItem
.
isTakeoffItem
verticalAlignment
:
Text
.
AlignVCenter
text
:
missionItem
.
commandName
color
:
_outerTextColor
}
}
QGCColoredImage
{
id
:
hamburger
anchors.
rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.
margins
:
_margin
anchors.right
:
parent
.
right
anchors.verticalCenter
:
commandPicker
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
_hamburgerSize
height
:
_hamburgerSize
sourceSize.height
:
_hamburgerSize
source
:
"
qrc:/qmlimages/Hamburger.svg
"
visible
:
missionItem
.
isCurrentItem
&&
missionItem
.
sequenceNumber
!==
0
color
:
qgcPal
.
text
}
QGCMouseArea
{
fillItem
:
hamburger
visible
:
hamburger
.
visible
onClicked
:
{
currentItemScope
.
focus
=
true
hamburgerMenu
.
popup
()
...
...
@@ -187,100 +254,36 @@ Rectangle {
}
}
}
QGCColoredImage
{
id
:
deleteButton
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.verticalCenter
:
commandPicker
.
verticalCenter
height
:
_hamburgerSize
width
:
height
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
color
:
qgcPal
.
text
visible
:
_currentItem
&&
missionItem
.
sequenceNumber
!==
0
source
:
"
/res/TrashDelete.svg
"
QGCMouseArea
{
fillItem
:
parent
onClicked
:
remove
()
}
}
Rectangle
{
id
:
commandPicker
/*
QGCLabel {
id: notReadyForSaveLabel
anchors.margins: _margin
anchors.left
:
deleteButton
.
right
anchors.top
:
parent
.
top
height
:
ScreenTools
.
implicitComboBoxHeight
width
:
innerLayout
.
x
+
innerLayout
.
width
+
ScreenTools
.
comboBoxPadding
visible
:
!
commandLabel
.
visible
color
:
qgcPal
.
window
border.width
:
1
border.color
:
qgcPal
.
text
RowLayout
{
id
:
innerLayout
anchors.margins
:
_padding
anchors.left
:
parent
.
left
anchors.verticalCenter
:
parent
.
verticalCenter
spacing
:
_padding
property
real
_padding
:
ScreenTools
.
comboBoxPadding
QGCLabel
{
text
:
missionItem
.
commandName
}
QGCColoredImage
{
height
:
ScreenTools
.
defaultFontPixelWidth
width
:
height
fillMode
:
Image
.
PreserveAspectFit
smooth
:
true
antialiasing
:
true
color
:
qgcPal
.
text
source
:
"
/qmlimages/arrow-down.png
"
}
}
QGCMouseArea
{
fillItem
:
parent
onClicked
:
mainWindow
.
showComponentDialog
(
commandDialog
,
qsTr
(
"
Select Mission Command
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
Component
{
id
:
commandDialog
MissionCommandDialog
{
missionItem
:
_root
.
missionItem
map
:
_root
.
map
// FIXME: Disabling fly through commands doesn't work since you may need to change from an RTL to something else
flyThroughCommandsAllowed
:
true
//_missionController.flyThroughCommandsAllowed
}
}
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
}
QGCLabel
{
id
:
commandLabel
anchors.leftMargin
:
ScreenTools
.
comboBoxPadding
anchors.fill
:
commandPicker
visible
:
!
missionItem
.
isCurrentItem
||
!
missionItem
.
isSimpleItem
||
_waypointsOnlyMode
||
missionItem
.
isTakeoffItem
verticalAlignment
:
Text
.
AlignVCenter
text
:
missionItem
.
commandName
color
:
_outerTextColor
}
*/
Loader
{
id
:
editorLoader
anchors.margins
:
_
m
argin
anchors.margins
:
_
innerM
argin
anchors.left
:
parent
.
left
anchors.top
:
_readyForSave
?
commandPicker
.
bottom
:
notReadyForSaveLabel
.
bottom
anchors.top
:
topRowLayout
.
bottom
source
:
missionItem
.
editorQml
visible
:
_currentItem
property
var
masterController
:
_masterController
property
real
availableWidth
:
_root
.
width
-
(
_margin
*
2
)
///< How wide the editor should be
property
real
availableWidth
:
_root
.
width
-
(
anchors
.
margins
*
2
)
///< How wide the editor should be
property
var
editorRoot
:
_root
}
}
// Rectangle
src/PlanView/PlanView.qml
View file @
6762622d
...
...
@@ -49,7 +49,7 @@ Item {
property
bool
_addWaypointOnClick
:
false
property
bool
_addROIOnClick
:
false
property
bool
_singleComplexItem
:
_missionController
.
complexMissionItemNames
.
length
===
1
property
int
_editingLayer
:
bar
.
currentIndex
?
_layers
[
b
ar
.
currentIndex
]
:
_layerMission
property
int
_editingLayer
:
layerTabBar
.
currentIndex
?
_layers
[
layerTabB
ar
.
currentIndex
]
:
_layerMission
property
int
_toolStripBottom
:
toolStrip
.
height
+
toolStrip
.
y
property
var
_appSettings
:
QGroundControl
.
settingsManager
.
appSettings
property
var
_planViewSettings
:
QGroundControl
.
settingsManager
.
planViewSettings
...
...
@@ -704,7 +704,7 @@ Item {
height
:
parent
.
height
width
:
_rightPanelWidth
color
:
qgcPal
.
window
opacity
:
planExpanded
.
visible
?
0.2
:
0
opacity
:
layerTabBar
.
visible
?
0.2
:
0
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.rightMargin
:
_toolsMargin
...
...
@@ -781,26 +781,11 @@ Item {
}
//-------------------------------------------------------
// Mission Controls (Expanded)
Rectangle
{
id
:
planExpanded
width
:
parent
.
width
height
:
(
!
planControlColapsed
||
!
_airspaceEnabled
)
?
bar
.
height
+
ScreenTools
.
defaultFontPixelHeight
:
0
color
:
qgcPal
.
missionItemEditor
radius
:
_radius
visible
:
(
!
planControlColapsed
||
!
_airspaceEnabled
)
&&
QGroundControl
.
corePlugin
.
options
.
enablePlanViewSelector
Item
{
height
:
bar
.
height
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.verticalCenter
:
parent
.
verticalCenter
QGCTabBar
{
id
:
b
ar
id
:
layerTabB
ar
width
:
parent
.
width
anchors.centerIn
:
parent
Component.onCompleted
:
{
currentIndex
=
0
}
visible
:
(
!
planControlColapsed
||
!
_airspaceEnabled
)
&&
QGroundControl
.
corePlugin
.
options
.
enablePlanViewSelector
Component.onCompleted
:
currentIndex
=
0
QGCTabButton
{
text
:
qsTr
(
"
Mission
"
)
}
...
...
@@ -814,8 +799,6 @@ Item {
}
}
}
}
}
//-------------------------------------------------------
// Mission Item Editor
Item
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment