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
Hide 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 {
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
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
]
horizontal
:
tru
e
horizontal
:
fals
e
enableSwitchButton
:
true
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>
*
...
...
@@ -35,7 +35,6 @@ Rectangle {
property
bool
enableSwitchButton
:
false
/// enable horizontal vertical button ?
property
real
_horizontal
:
horizontal
signal
clicked
(
int
index
,
bool
checked
)
...
...
@@ -43,7 +42,11 @@ Rectangle {
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
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
}
ExclusiveGroup
{
id
:
dropButtonsExclusiveGroup
}
...
...
@@ -62,37 +65,40 @@ Rectangle {
anchors.fill
:
parent
}
Grid
Layout
{
Grid
{
id
:
toolStripGrid
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
columnSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
rows
:
_horizontal
?
1
:
model
.
length
columns
:
_horizontal
?
model
.
length
:
1
rows
:
toolStripGrid
.
horizontal
?
1
:
model
.
length
columns
:
toolStripGrid
.
horizontal
?
model
.
length
:
1
property
bool
horizontal
QGCLabel
{
text
:
title
font.pointSize
:
ScreenTools
.
mobile
?
ScreenTools
.
smallFontPointSize
:
ScreenTools
.
defaultFontPointSize
Layout.alignment
:
_horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
Layout.alignment
:
toolStripGrid
.
horizontal
?
Qt
.
AlignVCenter
:
Qt
.
AlignHCenter
}
// separator
Rectangle
{
height
:
_horizontal
?
undefined
:
1
width
:
_horizontal
?
1
:
undefined
Layout.fillWidth
:
_horizontal
?
false
:
true
Layout.fillHeight
:
_horizontal
?
true
:
false
height
:
toolStripGrid
.
horizontal
?
_buttonWidthHeight
:
1
width
:
toolStripGrid
.
horizontal
?
1
:
_buttonWidthHeight
color
:
qgcPal
.
text
}
GridLayout
{
rows
:
_
horizontal
?
1
:
model
.
length
columns
:
_
horizontal
?
model
.
length
:
1
rows
:
toolStripGrid
.
horizontal
?
1
:
model
.
length
columns
:
toolStripGrid
.
horizontal
?
model
.
length
:
1
columnSpacing
:
_buttonSpacing
rowSpacing
:
_buttonSpacing
Repeater
{
id
:
repeater
...
...
@@ -101,7 +107,7 @@ Rectangle {
width
:
buttonRect
.
width
height
:
buttonRect
.
height
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
ExclusiveGroup
exclusiveGroup
:
dropButtonsExclusiveGroup
...
...
@@ -145,56 +151,54 @@ Rectangle {
id
:
buttonRect
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
height
:
buttonColumn
.
h
eight
width
:
buttonColumn
.
width
height
:
_buttonWidthH
eight
width
:
_buttonWidthHeight
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlight
:
_repeaterPal
.
window
Column
{
id
:
buttonColumn
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_buttonSpacing
QGCColoredImage
{
id
:
buttonImage
height
:
_imageWidthHeight
width
:
_imageWidthHeight
//anchors.centerIn: parent
source
:
_source
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
RotationAnimation
on
rotation
{
id
:
imageRotation
loops
:
Animation
.
Infinite
from
:
0
to
:
360
duration
:
500
running
:
false
}
NumberAnimation
on
opacity
{
id
:
opacityAnimation
running
:
false
from
:
0
to
:
1.0
loops
:
Animation
.
Infinite
duration
:
2000
}
clip
:
true
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCColoredImage
{
id
:
buttonImage
height
:
_buttonWidthHeight
-
buttonLabel
.
height
width
:
_buttonWidthHeight
-
buttonLabel
.
height
anchors.centerIn
:
parent
source
:
_source
sourceSize.height
:
_buttonWidthHeight
-
buttonLabel
.
height
sourceSize.width
:
_buttonWidthHeight
-
buttonLabel
.
height
fillMode
:
Image
.
PreserveAspectCrop
mipmap
:
true
smooth
:
true
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
RotationAnimation
on
rotation
{
id
:
imageRotation
loops
:
Animation
.
Infinite
from
:
0
to
:
360
duration
:
500
running
:
false
}
QGCLabel
{
id
:
buttonLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
f
ont.pointSize
:
ScreenTools
.
smallFontPointSize
t
ext
:
modelData
.
name
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
enabled
:
_buttonEnabled
NumberAnimation
on
opacity
{
id
:
opacityAnimation
running
:
false
f
rom
:
0
t
o
:
1.0
loops
:
Animation
.
Infinite
duration
:
2000
}
}
// Column
}
QGCLabel
{
id
:
buttonLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.bottom
:
parent
.
bottom
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
modelData
.
name
color
:
_showHighlight
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
text
enabled
:
_buttonEnabled
}
QGCMouseArea
{
anchors.fill
:
parent
...
...
@@ -236,10 +240,8 @@ Rectangle {
// separator
Rectangle
{
height
:
_horizontal
?
undefined
:
1
width
:
_horizontal
?
1
:
undefined
Layout.fillWidth
:
_horizontal
?
false
:
true
Layout.fillHeight
:
_horizontal
?
true
:
false
height
:
toolStripGrid
.
horizontal
?
_buttonWidthHeight
:
1
width
:
toolStripGrid
.
horizontal
?
1
:
_buttonWidthHeight
color
:
qgcPal
.
text
visible
:
enableSwitchButton
}
...
...
@@ -247,44 +249,41 @@ Rectangle {
// switch button, tool strip horizontal <-> vertical
Rectangle
{
id
:
switchButtonRect
height
:
switchButtonColumn
.
h
eight
width
:
switchButtonColumn
.
width
height
:
_buttonWidthH
eight
width
:
_buttonWidthHeight
color
:
_showHighlight
?
_switchButtonPal
.
buttonHighlight
:
_switchButtonPal
.
window
visible
:
enableSwitchButton
visible
:
enableSwitchButton
radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
bool
_hovered
:
false
property
bool
_showHighlight
:
(
enableSwitchButton
&&
_hovered
)
QGCPalette
{
id
:
_switchButtonPal
;
colorGroupEnabled
:
enableSwitchButton
}
Column
{
id
:
switchButtonColumn
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_buttonSpacing
QGCColoredImage
{
id
:
switchButtonImage
height
:
_imageWidthHeight
width
:
_imageWidthHeight
//anchors.centerIn: parent
source
:
"
/res/clockwise-arrow.svg
"
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
}
QGCColoredImage
{
id
:
switchButtonImage
height
:
_buttonWidthHeight
-
switchButtonLabel
.
height
width
:
_buttonWidthHeight
-
switchButtonLabel
.
height
anchors.top
:
parent
.
top
anchors.centerIn
:
parent
source
:
"
/res/clockwise-arrow.svg
"
sourceSize.height
:
_buttonWidthHeight
-
switchButtonLabel
.
height
sourceSize.width
:
_buttonWidthHeight
-
switchButtonLabel
.
height
fillMode
:
Image
.
PreserveAspectCrop
mipmap
:
true
smooth
:
true
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
}
QGCLabel
{
id
:
switchButtonLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
_horizontal
?
"
Vert
"
:
"
Hor
"
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
enabled
:
enableSwitchButton
}
}
// Column
QGCLabel
{
id
:
switchButtonLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.bottom
:
parent
.
bottom
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
toolStripGrid
.
horizontal
?
"
Vert
"
:
"
Hor
"
color
:
switchButtonRect
.
_showHighlight
?
_switchButtonPal
.
buttonHighlightText
:
_switchButtonPal
.
text
enabled
:
enableSwitchButton
}
QGCMouseArea
{
anchors.fill
:
parent
...
...
@@ -297,10 +296,10 @@ Rectangle {
onClicked
:
{
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
if
(
_root
.
_
horizontal
===
true
)
{
_root
.
_
horizontal
=
false
if
(
toolStripGrid
.
horizontal
===
true
)
{
toolStripGrid
.
horizontal
=
false
}
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