Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
0ad9f79d
Commit
0ad9f79d
authored
8 years ago
by
Don Gagne
Browse files
Options
Downloads
Patches
Plain Diff
ToolStrip auto-determine show/hide elements for fit
parent
fc3f1350
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/FlightDisplay/FlightDisplayViewMap.qml
+1
-0
1 addition, 0 deletions
src/FlightDisplay/FlightDisplayViewMap.qml
src/MissionEditor/MissionEditor.qml
+2
-0
2 additions, 0 deletions
src/MissionEditor/MissionEditor.qml
src/QmlControls/ToolStrip.qml
+43
-5
43 additions, 5 deletions
src/QmlControls/ToolStrip.qml
with
46 additions
and
5 deletions
src/FlightDisplay/FlightDisplayViewMap.qml
+
1
−
0
View file @
0ad9f79d
...
@@ -85,6 +85,7 @@ FlightMap {
...
@@ -85,6 +85,7 @@ FlightMap {
title
:
qsTr
(
"
Fly
"
)
title
:
qsTr
(
"
Fly
"
)
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
buttonVisible
:
[
true
,
true
,
_showZoom
,
_showZoom
]
buttonVisible
:
[
true
,
true
,
_showZoom
,
_showZoom
]
maxHeight
:
(
_flightVideo
.
visible
?
_flightVideo
.
y
:
parent
.
height
)
-
toolStrip
.
y
// Massive reach across hack
property
bool
_showZoom
:
!
ScreenTools
.
isShortScreen
property
bool
_showZoom
:
!
ScreenTools
.
isShortScreen
...
...
This diff is collapsed.
Click to expand it.
src/MissionEditor/MissionEditor.qml
+
2
−
0
View file @
0ad9f79d
...
@@ -777,6 +777,7 @@ QGCView {
...
@@ -777,6 +777,7 @@ QGCView {
rotateImage
:
[
false
,
false
,
_syncDropDownController
.
syncInProgress
,
false
,
false
,
false
,
false
]
rotateImage
:
[
false
,
false
,
_syncDropDownController
.
syncInProgress
,
false
,
false
,
false
,
false
]
buttonEnabled
:
[
true
,
true
,
!
_syncDropDownController
.
syncInProgress
,
true
,
true
,
true
,
true
]
buttonEnabled
:
[
true
,
true
,
!
_syncDropDownController
.
syncInProgress
,
true
,
true
,
true
,
true
]
buttonVisible
:
[
true
,
true
,
true
,
true
,
true
,
_showZoom
,
_showZoom
]
buttonVisible
:
[
true
,
true
,
true
,
true
,
true
,
_showZoom
,
_showZoom
]
maxHeight
:
mapScale
.
y
-
toolStrip
.
y
property
bool
_showZoom
:
!
ScreenTools
.
isShortScreen
property
bool
_showZoom
:
!
ScreenTools
.
isShortScreen
...
@@ -839,6 +840,7 @@ QGCView {
...
@@ -839,6 +840,7 @@ QGCView {
}
}
MapScale
{
MapScale
{
id
:
mapScale
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.66
)
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
(
0.66
)
anchors.bottom
:
waypointValuesDisplay
.
visible
?
waypointValuesDisplay
.
top
:
parent
.
bottom
anchors.bottom
:
waypointValuesDisplay
.
visible
?
waypointValuesDisplay
.
top
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
...
...
This diff is collapsed.
Click to expand it.
src/QmlControls/ToolStrip.qml
+
43
−
5
View file @
0ad9f79d
...
@@ -22,17 +22,55 @@ Rectangle {
...
@@ -22,17 +22,55 @@ Rectangle {
property
string
title
:
"
Title
"
property
string
title
:
"
Title
"
property
alias
model
:
repeater
.
model
property
alias
model
:
repeater
.
model
property
var
showAlternateIcon
property
var
showAlternateIcon
///< List of bool values, one for each button in strip - true: show alternate icon, false: show normal icon
property
var
rotateImage
property
var
rotateImage
///< List of bool values, one for each button in strip - true: animation rotation, false: static image
property
var
buttonEnabled
property
var
buttonEnabled
///< List of bool values, one for each button in strip - true: button enabled, false: button disabled
property
var
buttonVisible
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
)
signal
clicked
(
int
index
,
bool
checked
)
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_buttonSpacing
:
ScreenTools
.
defaultFontPixelWidth
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
}
QGCPalette
{
id
:
qgcPal
}
ExclusiveGroup
{
id
:
dropButtonsExclusiveGroup
}
ExclusiveGroup
{
id
:
dropButtonsExclusiveGroup
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment