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
b9bb4442
Commit
b9bb4442
authored
Feb 27, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toolstrip.qml edited, almost finised
parent
2814c345
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
98 deletions
+97
-98
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+1
-1
ToolStrip.qml
src/QmlControls/ToolStrip.qml
+96
-97
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
b9bb4442
...
@@ -679,7 +679,7 @@ QGCView {
...
@@ -679,7 +679,7 @@ QGCView {
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
buttonVisible
:
[
_useChecklist
,
_guidedController
.
showTakeoff
||
!
_guidedController
.
showLand
,
_guidedController
.
showLand
&&
!
_guidedController
.
showTakeoff
,
true
,
true
,
true
]
buttonVisible
:
[
_useChecklist
,
_guidedController
.
showTakeoff
||
!
_guidedController
.
showLand
,
_guidedController
.
showLand
&&
!
_guidedController
.
showTakeoff
,
true
,
true
,
true
]
buttonEnabled
:
[
_useChecklist
&&
_activeVehicle
,
_guidedController
.
showTakeoff
,
_guidedController
.
showLand
,
_guidedController
.
showRTL
,
_guidedController
.
showPause
,
_anyActionAvailable
]
buttonEnabled
:
[
_useChecklist
&&
_activeVehicle
,
_guidedController
.
showTakeoff
,
_guidedController
.
showLand
,
_guidedController
.
showRTL
,
_guidedController
.
showPause
,
_anyActionAvailable
]
horizontal
:
tru
e
horizontal
:
fals
e
enableSwitchButton
:
true
enableSwitchButton
:
true
property
bool
_anyActionAvailable
:
_guidedController
.
showStartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
property
bool
_anyActionAvailable
:
_guidedController
.
showStartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
...
...
src/QmlControls/ToolStrip.qml
View file @
b9bb4442
/****************************************************************************
/****************************************************************************
*
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
*
...
@@ -35,7 +35,6 @@ Rectangle {
...
@@ -35,7 +35,6 @@ Rectangle {
property
bool
enableSwitchButton
:
false
/// enable horizontal vertical button ?
property
bool
enableSwitchButton
:
false
/// enable horizontal vertical button ?
property
real
_horizontal
:
horizontal
signal
clicked
(
int
index
,
bool
checked
)
signal
clicked
(
int
index
,
bool
checked
)
...
@@ -43,7 +42,11 @@ Rectangle {
...
@@ -43,7 +42,11 @@ Rectangle {
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_buttonSpacing
:
ScreenTools
.
defaultFontPixelHeight
/
4
readonly
property
real
_buttonSpacing
:
ScreenTools
.
defaultFontPixelHeight
/
4
readonly
property
real
_imageWidthHeight
:
ScreenTools
.
isMobile
?
ScreenTools
.
minTouchPixels
:
ScreenTools
.
defaultFontPixelWidth
*
5
readonly
property
real
_buttonWidthHeight
:
ScreenTools
.
isMobile
?
ScreenTools
.
minTouchPixels
:
ScreenTools
.
defaultFontPixelWidth
*
8
Component.onCompleted
:
toolStripGrid
.
horizontal
=
_root
.
horizontal
onHorizontalChanged
:
toolStripGrid
.
horizontal
=
_root
.
horizontal
QGCPalette
{
id
:
qgcPal
}
QGCPalette
{
id
:
qgcPal
}
ExclusiveGroup
{
id
:
dropButtonsExclusiveGroup
}
ExclusiveGroup
{
id
:
dropButtonsExclusiveGroup
}
...
@@ -62,37 +65,40 @@ Rectangle {
...
@@ -62,37 +65,40 @@ Rectangle {
anchors.fill
:
parent
anchors.fill
:
parent
}
}
Grid
Layout
{
Grid
{
id
:
toolStripGrid
id
:
toolStripGrid
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
columnSpacing
:
_buttonSpacing
columnSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
rows
:
_horizontal
?
1
:
model
.
length
rows
:
toolStripGrid
.
horizontal
?
1
:
model
.
length
columns
:
_horizontal
?
model
.
length
:
1
columns
:
toolStripGrid
.
horizontal
?
model
.
length
:
1
property
bool
horizontal
QGCLabel
{
QGCLabel
{
text
:
title
text
:
title
font.pointSize
:
ScreenTools
.
mobile
?
ScreenTools
.
smallFontPointSize
:
ScreenTools
.
defaultFontPointSize
font.pointSize
:
ScreenTools
.
mobile
?
ScreenTools
.
smallFontPointSize
:
ScreenTools
.
defaultFontPointSize
Layout.alignment
:
_horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
Layout.alignment
:
toolStripGrid
.
horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
}
}
// separator
// separator
Rectangle
{
Rectangle
{
height
:
_horizontal
?
undefined
:
1
height
:
toolStripGrid
.
horizontal
?
_buttonWidthHeight
:
1
width
:
_horizontal
?
1
:
undefined
width
:
toolStripGrid
.
horizontal
?
1
:
_buttonWidthHeight
Layout.fillWidth
:
_horizontal
?
false
:
true
Layout.fillHeight
:
_horizontal
?
true
:
false
color
:
qgcPal
.
text
color
:
qgcPal
.
text
}
}
GridLayout
{
GridLayout
{
rows
:
_
horizontal
?
1
:
model
.
length
rows
:
toolStripGrid
.
horizontal
?
1
:
model
.
length
columns
:
_
horizontal
?
model
.
length
:
1
columns
:
toolStripGrid
.
horizontal
?
model
.
length
:
1
columnSpacing
:
_buttonSpacing
columnSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
Repeater
{
Repeater
{
id
:
repeater
id
:
repeater
...
@@ -101,7 +107,7 @@ Rectangle {
...
@@ -101,7 +107,7 @@ Rectangle {
width
:
buttonRect
.
width
width
:
buttonRect
.
width
height
:
buttonRect
.
height
height
:
buttonRect
.
height
visible
:
_root
.
buttonVisible
?
_root
.
buttonVisible
[
index
]
:
true
visible
:
_root
.
buttonVisible
?
_root
.
buttonVisible
[
index
]
:
true
Layout.alignment
:
_
horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
Layout.alignment
:
toolStripGrid
.
horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
property
bool
checked
:
false
property
bool
checked
:
false
property
ExclusiveGroup
exclusiveGroup
:
dropButtonsExclusiveGroup
property
ExclusiveGroup
exclusiveGroup
:
dropButtonsExclusiveGroup
...
@@ -145,24 +151,21 @@ Rectangle {
...
@@ -145,24 +151,21 @@ Rectangle {
id
:
buttonRect
id
:
buttonRect
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
height
:
buttonColumn
.
h
eight
height
:
_buttonWidthH
eight
width
:
buttonColumn
.
width
width
:
_buttonWidthHeight
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlight
:
_repeaterPal
.
window
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlight
:
_repeaterPal
.
window
clip
:
true
Column
{
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
id
:
buttonColumn
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_buttonSpacing
QGCColoredImage
{
QGCColoredImage
{
id
:
buttonImage
id
:
buttonImage
height
:
_imageWidthH
eight
height
:
_buttonWidthHeight
-
buttonLabel
.
h
eight
width
:
_imageWidthH
eight
width
:
_buttonWidthHeight
-
buttonLabel
.
h
eight
//
anchors.centerIn: parent
anchors.centerIn
:
parent
source
:
_source
source
:
_source
sourceSize.height
:
height
sourceSize.height
:
_buttonWidthHeight
-
buttonLabel
.
height
fillMode
:
Image
.
PreserveAspectFit
sourceSize.width
:
_buttonWidthHeight
-
buttonLabel
.
height
fillMode
:
Image
.
PreserveAspectCrop
mipmap
:
true
mipmap
:
true
smooth
:
true
smooth
:
true
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
...
@@ -189,12 +192,13 @@ Rectangle {
...
@@ -189,12 +192,13 @@ Rectangle {
QGCLabel
{
QGCLabel
{
id
:
buttonLabel
id
:
buttonLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.bottom
:
parent
.
bottom
font.pointSize
:
ScreenTools
.
smallFontPointSize
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
modelData
.
name
text
:
modelData
.
name
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
enabled
:
_buttonEnabled
enabled
:
_buttonEnabled
}
}
}
// Column
QGCMouseArea
{
QGCMouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -236,10 +240,8 @@ Rectangle {
...
@@ -236,10 +240,8 @@ Rectangle {
// separator
// separator
Rectangle
{
Rectangle
{
height
:
_horizontal
?
undefined
:
1
height
:
toolStripGrid
.
horizontal
?
_buttonWidthHeight
:
1
width
:
_horizontal
?
1
:
undefined
width
:
toolStripGrid
.
horizontal
?
1
:
_buttonWidthHeight
Layout.fillWidth
:
_horizontal
?
false
:
true
Layout.fillHeight
:
_horizontal
?
true
:
false
color
:
qgcPal
.
text
color
:
qgcPal
.
text
visible
:
enableSwitchButton
visible
:
enableSwitchButton
}
}
...
@@ -247,30 +249,27 @@ Rectangle {
...
@@ -247,30 +249,27 @@ Rectangle {
// switch button, tool strip horizontal <-> vertical
// switch button, tool strip horizontal <-> vertical
Rectangle
{
Rectangle
{
id
:
switchButtonRect
id
:
switchButtonRect
height
:
switchButtonColumn
.
h
eight
height
:
_buttonWidthH
eight
width
:
switchButtonColumn
.
width
width
:
_buttonWidthHeight
color
:
_showHighlight
?
_switchButtonPal
.
buttonHighlight
:
_switchButtonPal
.
window
color
:
_showHighlight
?
_switchButtonPal
.
buttonHighlight
:
_switchButtonPal
.
window
visible
:
enableSwitchButton
visible
:
enableSwitchButton
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
bool
_hovered
:
false
property
bool
_hovered
:
false
property
bool
_showHighlight
:
(
enableSwitchButton
&&
_hovered
)
property
bool
_showHighlight
:
(
enableSwitchButton
&&
_hovered
)
QGCPalette
{
id
:
_switchButtonPal
;
colorGroupEnabled
:
enableSwitchButton
}
QGCPalette
{
id
:
_switchButtonPal
;
colorGroupEnabled
:
enableSwitchButton
}
Column
{
id
:
switchButtonColumn
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_buttonSpacing
QGCColoredImage
{
QGCColoredImage
{
id
:
switchButtonImage
id
:
switchButtonImage
height
:
_imageWidthHeight
height
:
_buttonWidthHeight
-
switchButtonLabel
.
height
width
:
_imageWidthHeight
width
:
_buttonWidthHeight
-
switchButtonLabel
.
height
//anchors.centerIn: parent
anchors.top
:
parent
.
top
anchors.centerIn
:
parent
source
:
"
/res/clockwise-arrow.svg
"
source
:
"
/res/clockwise-arrow.svg
"
sourceSize.height
:
height
sourceSize.height
:
_buttonWidthHeight
-
switchButtonLabel
.
height
fillMode
:
Image
.
PreserveAspectFit
sourceSize.width
:
_buttonWidthHeight
-
switchButtonLabel
.
height
fillMode
:
Image
.
PreserveAspectCrop
mipmap
:
true
mipmap
:
true
smooth
:
true
smooth
:
true
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
...
@@ -279,12 +278,12 @@ Rectangle {
...
@@ -279,12 +278,12 @@ Rectangle {
QGCLabel
{
QGCLabel
{
id
:
switchButtonLabel
id
:
switchButtonLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.bottom
:
parent
.
bottom
font.pointSize
:
ScreenTools
.
smallFontPointSize
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
_
horizontal
?
"
Vert
"
:
"
Hor
"
text
:
toolStripGrid
.
horizontal
?
"
Vert
"
:
"
Hor
"
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
enabled
:
enableSwitchButton
enabled
:
enableSwitchButton
}
}
}
// Column
QGCMouseArea
{
QGCMouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -297,10 +296,10 @@ Rectangle {
...
@@ -297,10 +296,10 @@ Rectangle {
onClicked
:
{
onClicked
:
{
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
if
(
_root
.
_
horizontal
===
true
)
{
if
(
toolStripGrid
.
horizontal
===
true
)
{
_root
.
_
horizontal
=
false
toolStripGrid
.
horizontal
=
false
}
else
{
}
else
{
_root
.
_
horizontal
=
true
toolStripGrid
.
horizontal
=
true
}
}
}
}
}
}
...
...
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