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
0ad9f79d
Commit
0ad9f79d
authored
Mar 01, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ToolStrip auto-determine show/hide elements for fit
parent
fc3f1350
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
5 deletions
+46
-5
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+1
-0
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+2
-0
ToolStrip.qml
src/QmlControls/ToolStrip.qml
+43
-5
No files found.
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
0ad9f79d
...
...
@@ -85,6 +85,7 @@ FlightMap {
title
:
qsTr
(
"
Fly
"
)
z
:
QGroundControl
.
zOrderWidgets
buttonVisible
:
[
true
,
true
,
_showZoom
,
_showZoom
]
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
// Massive reach across hack
property
bool
_showZoom
:
!
ScreenTools
.
isShortScreen
...
...
src/MissionEditor/MissionEditor.qml
View file @
0ad9f79d
...
...
@@ -777,6 +777,7 @@ QGCView {
rotateImage
:
[
false
,
false
,
_syncDropDownController
.
syncInProgress
,
false
,
false
,
false
,
false
]
buttonEnabled
:
[
true
,
true
,
!
_syncDropDownController
.
syncInProgress
,
true
,
true
,
true
,
true
]
buttonVisible
:
[
true
,
true
,
true
,
true
,
true
,
_showZoom
,
_showZoom
]
maxHeight
:
mapScale
.
y
-
toolStrip
.
y
property
bool
_showZoom
:
!
ScreenTools
.
isShortScreen
...
...
@@ -839,6 +840,7 @@ QGCView {
}
MapScale
{
id
:
mapScale
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.66
)
anchors.bottom
:
waypointValuesDisplay
.
visible
?
waypointValuesDisplay
.
top
:
parent
.
bottom
anchors.left
:
parent
.
left
...
...
src/QmlControls/ToolStrip.qml
View file @
0ad9f79d
...
...
@@ -22,17 +22,55 @@ Rectangle {
property
string
title
:
"
Title
"
property
alias
model
:
repeater
.
model
property
var
showAlternateIcon
property
var
rotateImage
property
var
buttonEnabled
property
var
buttonVisible
property
var
showAlternateIcon
///< List of bool values, one for each button in strip - true: show alternate icon, false: show normal icon
property
var
rotateImage
///< List of bool values, one for each button in strip - true: animation rotation, false: static image
property
var
buttonEnabled
///< List of bool values, one for each button in strip - true: button enabled, false: button disabled
property
var
buttonVisible
///< List of bool values, one for each button in strip - true: button visible, false: button invisible
property
real
maxHeight
///< Maximum height for control, determines whether text is hidden to make control shorter
signal
clicked
(
int
index
,
bool
checked
)
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_buttonSpacing
:
ScreenTools
.
defaultFontPixelWidth
readonly
property
bool
_showOptionalElements
:
!
ScreenTools
.
isShortScreen
// All of the following values, connections and function are to support the ability to determine
// whether to show or hide the optional elements on the fly.
property
bool
_showOptionalElements
:
true
property
bool
_needRecalc
:
true
Component.onCompleted
:
recalcShowOptionalElements
()
onMaxHeightChanged
:
recalcShowOptionalElements
()
Connections
{
target
:
ScreenTools
onDefaultFontPixelWidthChanged
:
recalcShowOptionalElements
()
onDefaultFontPixelHeightChanged
:
recalcShowOptionalElements
()
}
onHeightChanged
:
{
if
(
_needRecalc
)
{
_needRecalc
=
false
if
(
maxHeight
&&
height
>
maxHeight
)
{
_showOptionalElements
=
false
}
}
}
function
recalcShowOptionalElements
()
{
if
(
_showOptionalElements
)
{
if
(
maxHeight
&&
height
>
maxHeight
)
{
_showOptionalElements
=
false
}
}
else
{
_needRecalc
=
true
_showOptionalElements
=
true
}
}
QGCPalette
{
id
:
qgcPal
}
ExclusiveGroup
{
id
:
dropButtonsExclusiveGroup
}
...
...
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