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
18cf8ba9
Commit
18cf8ba9
authored
Apr 22, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing the Mission Editor view to respect the view area (so the map extends beneath the toolbar)
parent
28373366
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
27 deletions
+39
-27
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+34
-19
MainWindowInner.qml
src/ui/MainWindowInner.qml
+5
-8
No files found.
src/MissionEditor/MissionEditor.qml
View file @
18cf8ba9
...
@@ -90,7 +90,7 @@ QGCView {
...
@@ -90,7 +90,7 @@ QGCView {
function
loadFromFile
()
{
function
loadFromFile
()
{
if
(
ScreenTools
.
isMobile
)
{
if
(
ScreenTools
.
isMobile
)
{
_root
.
showDialog
(
mobileFilePicker
,
qsTr
(
"
Select Mission File
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
)
_root
.
showDialog
(
mobileFilePicker
,
qsTr
(
"
Select Mission File
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
,
true
)
}
else
{
}
else
{
controller
.
loadMissionFromFilePicker
()
controller
.
loadMissionFromFilePicker
()
fitViewportToMissionItems
()
fitViewportToMissionItems
()
...
@@ -99,7 +99,7 @@ QGCView {
...
@@ -99,7 +99,7 @@ QGCView {
function
saveToFile
()
{
function
saveToFile
()
{
if
(
ScreenTools
.
isMobile
)
{
if
(
ScreenTools
.
isMobile
)
{
_root
.
showDialog
(
mobileFileSaver
,
qsTr
(
"
Save Mission File
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Save
|
StandardButton
.
Cancel
)
_root
.
showDialog
(
mobileFileSaver
,
qsTr
(
"
Save Mission File
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Save
|
StandardButton
.
Cancel
,
true
)
}
else
{
}
else
{
controller
.
saveMissionToFilePicker
()
controller
.
saveMissionToFilePicker
()
}
}
...
@@ -252,14 +252,20 @@ QGCView {
...
@@ -252,14 +252,20 @@ QGCView {
QGCViewPanel
{
QGCViewPanel
{
id
:
panel
id
:
panel
anchors.fill
:
parent
height
:
ScreenTools
.
availableHeight
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
Item
{
Item
{
anchors.fill
:
parent
anchors.fill
:
parent
FlightMap
{
FlightMap
{
id
:
editorMap
id
:
editorMap
anchors.fill
:
parent
height
:
_root
.
height
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
mapName
:
"
MissionEditor
"
mapName
:
"
MissionEditor
"
signal
mapClicked
(
var
coordinate
)
signal
mapClicked
(
var
coordinate
)
...
@@ -277,19 +283,24 @@ QGCView {
...
@@ -277,19 +283,24 @@ QGCView {
}
}
MouseArea
{
MouseArea
{
//-- It's a whole lot faster to just fill parent and deal with top offset below
// than computing the coordinate offset.
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
var
coordinate
=
editorMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
//-- Don't pay attention to items beneath the toolbar.
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
var
topLimit
=
parent
.
height
-
ScreenTools
.
availableHeight
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
if
(
mouse
.
y
>=
topLimit
)
{
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
var
coordinate
=
editorMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
if
(
addMissionItemsButton
.
checked
)
{
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
var
sequenceNumber
=
controller
.
insertSimpleMissionItem
(
coordinate
,
controller
.
visualItems
.
count
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
setCurrentItem
(
sequenceNumber
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
editorListView
.
positionViewAtIndex
(
editorListView
.
count
-
1
,
ListView
.
Contain
)
if
(
addMissionItemsButton
.
checked
)
{
}
else
{
var
sequenceNumber
=
controller
.
insertSimpleMissionItem
(
coordinate
,
controller
.
visualItems
.
count
)
editorMap
.
mapClicked
(
coordinate
)
setCurrentItem
(
sequenceNumber
)
editorListView
.
positionViewAtIndex
(
editorListView
.
count
-
1
,
ListView
.
Contain
)
}
else
{
editorMap
.
mapClicked
(
coordinate
)
}
}
}
}
}
}
}
...
@@ -399,6 +410,9 @@ QGCView {
...
@@ -399,6 +410,9 @@ QGCView {
missionItem
:
object
missionItem
:
object
sequenceNumber
:
object
.
sequenceNumber
sequenceNumber
:
object
.
sequenceNumber
//-- If you don't want to allow selecting items beneath the
// toolbar, the code below has to check and see if mouse.y
// is greater than (map.height - ScreenTools.availableHeight)
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
function
updateItemIndicator
()
{
function
updateItemIndicator
()
{
...
@@ -458,7 +472,7 @@ QGCView {
...
@@ -458,7 +472,7 @@ QGCView {
// Mission Item Editor
// Mission Item Editor
Item
{
Item
{
id
:
missionItemEditor
id
:
missionItemEditor
anchors.top
:
parent
.
top
height
:
ScreenTools
.
availableHeight
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
width
:
_rightPanelWidth
width
:
_rightPanelWidth
...
@@ -530,6 +544,7 @@ QGCView {
...
@@ -530,6 +544,7 @@ QGCView {
//-- Vertical Tool Buttons
//-- Vertical Tool Buttons
Column
{
Column
{
id
:
toolColumn
id
:
toolColumn
anchors.topMargin
:
parent
.
height
-
ScreenTools
.
availableHeight
+
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
...
@@ -786,7 +801,7 @@ QGCView {
...
@@ -786,7 +801,7 @@ QGCView {
onClicked
:
{
onClicked
:
{
syncButton
.
hideDropDown
()
syncButton
.
hideDropDown
()
if
(
syncNeeded
)
{
if
(
syncNeeded
)
{
_root
.
showDialog
(
syncLoadFromVehicleOverwrite
,
qsTr
(
"
Mission overwrite
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
)
_root
.
showDialog
(
syncLoadFromVehicleOverwrite
,
qsTr
(
"
Mission overwrite
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
,
true
)
}
else
{
}
else
{
loadFromVehicle
()
loadFromVehicle
()
}
}
...
@@ -814,7 +829,7 @@ QGCView {
...
@@ -814,7 +829,7 @@ QGCView {
onClicked
:
{
onClicked
:
{
syncButton
.
hideDropDown
()
syncButton
.
hideDropDown
()
if
(
syncNeeded
)
{
if
(
syncNeeded
)
{
_root
.
showDialog
(
syncLoadFromFileOverwrite
,
qsTr
(
"
Mission overwrite
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
)
_root
.
showDialog
(
syncLoadFromFileOverwrite
,
qsTr
(
"
Mission overwrite
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
Cancel
,
true
)
}
else
{
}
else
{
loadFromFile
()
loadFromFile
()
}
}
...
@@ -826,7 +841,7 @@ QGCView {
...
@@ -826,7 +841,7 @@ QGCView {
text
:
qsTr
(
"
Remove all
"
)
text
:
qsTr
(
"
Remove all
"
)
onClicked
:
{
onClicked
:
{
syncButton
.
hideDropDown
()
syncButton
.
hideDropDown
()
_root
.
showDialog
(
removeAllPromptDialog
,
qsTr
(
"
Delete all
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
No
)
_root
.
showDialog
(
removeAllPromptDialog
,
qsTr
(
"
Delete all
"
),
_root
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
No
,
true
)
}
}
}
}
...
...
src/ui/MainWindowInner.qml
View file @
18cf8ba9
...
@@ -296,19 +296,16 @@ Item {
...
@@ -296,19 +296,16 @@ Item {
Loader
{
Loader
{
id
:
planViewLoader
id
:
planViewLoader
anchors.left
:
parent
.
left
anchors.fill
:
parent
anchors.right
:
parent
.
right
anchors.top
:
toolBar
.
bottom
anchors.bottom
:
parent
.
bottom
visible
:
false
visible
:
false
}
}
Loader
{
Loader
{
id
:
setupViewLoader
id
:
setupViewLoader
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.top
:
toolBar
.
bottom
anchors.top
:
toolBar
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
visible
:
false
visible
:
false
}
}
...
...
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