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
754c0249
Commit
754c0249
authored
Nov 14, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistent buttons in Fly and Mission views.
parent
e855eb08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
163 additions
and
135 deletions
+163
-135
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+163
-135
No files found.
src/MissionEditor/MissionEditor.qml
View file @
754c0249
...
@@ -46,7 +46,7 @@ QGCView {
...
@@ -46,7 +46,7 @@ QGCView {
z
:
QGroundControl
.
zOrderTopMost
z
:
QGroundControl
.
zOrderTopMost
readonly
property
int
_decimalPlaces
:
8
readonly
property
int
_decimalPlaces
:
8
readonly
property
real
_horizontalMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_horizontalMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelHeight
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelHeight
/
2
readonly
property
var
_activeVehicle
:
multiVehicleManager
.
activeVehicle
readonly
property
var
_activeVehicle
:
multiVehicleManager
.
activeVehicle
readonly
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
16
readonly
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
16
...
@@ -695,6 +695,17 @@ QGCView {
...
@@ -695,6 +695,17 @@ QGCView {
} // Item - Home Position Manager
} // Item - Home Position Manager
*/
*/
//-- Dismiss Drop Down (if any)
MouseArea
{
anchors.fill
:
parent
enabled
:
_dropButtonsExclusiveGroup
.
current
!=
null
onClicked
:
{
if
(
_dropButtonsExclusiveGroup
.
current
)
_dropButtonsExclusiveGroup
.
current
.
checked
=
false
_dropButtonsExclusiveGroup
.
current
=
null
}
}
//-- Help Panel
//-- Help Panel
Loader
{
Loader
{
id
:
helpPanel
id
:
helpPanel
...
@@ -705,169 +716,186 @@ QGCView {
...
@@ -705,169 +716,186 @@ QGCView {
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
Item
{
id
:
toolbarSpacer
height
:
mainWindow
.
tbHeight
width
:
1
}
//-- Vertical Tool Buttons
Column
{
id
:
toolColumn
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
parent
.
left
anchors.top
:
toolbarSpacer
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelHeight
RoundButton
{
id
:
addMissionItemsButton
buttonImage
:
"
/qmlimages/MapAddMission.svg
"
z
:
QGroundControl
.
zOrderWidgets
onCheckedChanged
:
{
if
(
checked
)
{
addMissionItemsButtonAutoOffTimer
.
start
()
}
else
{
addMissionItemsButtonAutoOffTimer
.
stop
()
}
}
RoundButton
{
Timer
{
id
:
addMissionItemsButton
id
:
addMissionItemsButtonAutoOffTimer
anchors.margins
:
_margin
interval
:
_addMissionItemsButtonAutoOffTimeout
anchors.left
:
parent
.
left
repeat
:
false
y
:
(
parent
.
height
-
(
_toolButtonCount
*
height
)
-
((
_toolButtonCount
-
1
)
*
_margin
))
/
2
buttonImage
:
"
/qmlimages/MapAddMission.svg
"
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
onCheckedChanged
:
{
onTriggered
:
addMissionItemsButton
.
checked
=
false
if
(
checked
)
{
addMissionItemsButtonAutoOffTimer
.
start
()
}
else
{
addMissionItemsButtonAutoOffTimer
.
stop
()
}
}
}
}
Timer
{
RoundButton
{
id
:
addMissionItemsButtonAutoOffTimer
id
:
deleteMissionItemButton
interval
:
_addMissionItemsButtonAutoOffTimeout
buttonImage
:
"
/qmlimages/TrashDelete.svg
"
repeat
:
false
z
:
QGroundControl
.
zOrderWidgets
onClicked
:
{
addMissionItemsButton
.
checked
=
false
itemDragger
.
clearItem
()
controller
.
deleteCurrentMissionItem
()
checked
=
false
}
}
onTriggered
:
addMissionItemsButton
.
checked
=
false
/*
Home Position manager temporarily disable
RoundButton {
id: homePositionManagerButton
buttonImage: "/qmlimages/MapHome.svg"
//exclusiveGroup: _dropButtonsExclusiveGroup
z: QGroundControl.zOrderWidgets
}
}
}
*/
RoundButton
{
DropButton
{
id
:
deleteMissionItemButton
id
:
centerMapButton
anchors.margins
:
_margin
dropDirection
:
dropRight
anchors.left
:
parent
.
left
buttonImage
:
"
/qmlimages/MapCenter.svg
"
anchors.top
:
addMissionItemsButton
.
bottom
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
buttonImage
:
"
/qmlimages/TrashDelete.svg
"
exclusiveGroup
:
_dropButtonsExclusiveGroup
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
onClicked
:
{
dropDownComponent
:
Component
{
itemDragger
.
clearItem
()
Column
{
controller
.
deleteCurrentMissionItem
()
QGCLabel
{
text
:
"
Center map:
"
}
checked
=
false
}
}
/*
Row
{
Home Position manager temporarily disable
spacing
:
ScreenTools
.
defaultFontPixelWidth
RoundButton {
id: homePositionManagerButton
anchors.margins: _margin
anchors.left: parent.left
anchors.top: deleteMissionItemButton.bottom
buttonImage: "/qmlimages/MapHome.svg"
exclusiveGroup: _dropButtonsExclusiveGroup
z: QGroundControl.zOrderWidgets
}
*/
DropButton
{
QGCButton
{
id
:
centerMapButton
text
:
"
Home
"
anchors.margins
:
_margin
enabled
:
liveHomePositionAvailable
anchors.left
:
parent
.
left
anchors.top
:
deleteMissionItemButton
.
bottom
onClicked
:
{
dropDirection
:
dropRight
centerMapButton
.
hideDropDown
()
buttonImage
:
"
/qmlimages/MapCenter.svg
"
editorMap
.
center
=
liveHomePosition
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
}
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
dropDownComponent
:
Component
{
Column
{
QGCLabel
{
text
:
"
Center map:
"
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCButton
{
text
:
"
Home
"
enabled
:
liveHomePositionAvailable
onClicked
:
{
centerMapButton
.
hideDropDown
()
editorMap
.
center
=
liveHomePosition
}
}
}
QGCButton
{
QGCButton
{
text
:
"
Vehicle
"
text
:
"
Vehicle
"
enabled
:
activeVehicle
&&
activeVehicle
.
latitude
!=
0
&&
activeVehicle
.
longitude
!=
0
enabled
:
activeVehicle
&&
activeVehicle
.
latitude
!=
0
&&
activeVehicle
.
longitude
!=
0
property
var
activeVehicle
:
multiVehicleManager
.
activeVehicle
property
var
activeVehicle
:
multiVehicleManager
.
activeVehicle
onClicked
:
{
onClicked
:
{
centerMapButton
.
hideDropDown
()
centerMapButton
.
hideDropDown
()
editorMap
.
latitude
=
activeVehicle
.
latitude
editorMap
.
latitude
=
activeVehicle
.
latitude
editorMap
.
longitude
=
activeVehicle
.
longitude
editorMap
.
longitude
=
activeVehicle
.
longitude
}
}
}
}
}
}
}
}
}
}
}
}
DropButton
{
id
:
syncButton
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.top
:
centerMapButton
.
bottom
dropDirection
:
dropRight
buttonImage
:
_syncNeeded
?
"
/qmlimages/MapSyncChanged.svg
"
:
"
/qmlimages/MapSync.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
dropDownComponent
:
syncDropDownComponent
enabled
:
!
_syncInProgress
}
DropButton
{
id
:
mapTypeButton
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.top
:
syncButton
.
bottom
dropDirection
:
dropRight
buttonImage
:
"
/qmlimages/MapType.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
dropDownComponent
:
Component
{
Column
{
QGCLabel
{
text
:
"
Map type:
"
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Repeater
{
DropButton
{
model
:
QGroundControl
.
flightMapSettings
.
mapTypes
id
:
syncButton
dropDirection
:
dropRight
QGCButton
{
buttonImage
:
_syncNeeded
?
"
/qmlimages/MapSyncChanged.svg
"
:
"
/qmlimages/MapSync.svg
"
checkable
:
true
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
checked
:
editorMap
.
mapType
==
text
exclusiveGroup
:
_dropButtonsExclusiveGroup
text
:
modelData
z
:
QGroundControl
.
zOrderWidgets
exclusiveGroup
:
_mapTypeButtonsExclusiveGroup
dropDownComponent
:
syncDropDownComponent
enabled
:
!
_syncInProgress
}
onClicked
:
{
DropButton
{
editorMap
.
mapType
=
text
id
:
mapTypeButton
checked
=
true
dropDirection
:
dropRight
mapTypeButton
.
hideDropDown
()
buttonImage
:
"
/qmlimages/MapType.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
dropDownComponent
:
Component
{
Column
{
QGCLabel
{
text
:
"
Map type:
"
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Repeater
{
model
:
QGroundControl
.
flightMapSettings
.
mapTypes
QGCButton
{
checkable
:
true
checked
:
editorMap
.
mapType
==
text
text
:
modelData
exclusiveGroup
:
_mapTypeButtonsExclusiveGroup
onClicked
:
{
editorMap
.
mapType
=
text
checked
=
true
mapTypeButton
.
hideDropDown
()
}
}
}
}
}
}
}
}
}
}
}
}
}
}
RoundButton
{
//-- Zoom Map In
id
:
helpButton
RoundButton
{
anchors.margins
:
_margin
id
:
mapZoomPlus
anchors.left
:
parent
.
left
visible
:
!
ScreenTools
.
isTinyScreen
anchors.top
:
mapTypeButton
.
bottom
buttonImage
:
"
/qmlimages/ZoomPlus.svg
"
buttonImage
:
"
/qmlimages/Help.svg
"
z
:
QGroundControl
.
zOrderWidgets
exclusiveGroup
:
_dropButtonsExclusiveGroup
onClicked
:
{
z
:
QGroundControl
.
zOrderWidgets
if
(
editorMap
)
checked
:
_showHelp
editorMap
.
zoomLevel
+=
0.5
checked
=
false
}
}
//-- Zoom Map Out
RoundButton
{
id
:
mapZoomMinus
visible
:
!
ScreenTools
.
isTinyScreen
buttonImage
:
"
/qmlimages/ZoomMinus.svg
"
z
:
QGroundControl
.
zOrderWidgets
onClicked
:
{
if
(
editorMap
)
editorMap
.
zoomLevel
-=
0.5
checked
=
false
}
}
RoundButton
{
id
:
helpButton
buttonImage
:
"
/qmlimages/Help.svg
"
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
checked
:
_showHelp
}
}
}
Rectangle
{
Rectangle
{
...
...
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