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
c1fee45f
Commit
c1fee45f
authored
Dec 17, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle dynamic sizing of setup buttons
parent
1e105f0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+4
-2
SetupView.qml
src/VehicleSetup/SetupView.qml
+24
-10
No files found.
src/QmlControls/SubMenuButton.qml
View file @
c1fee45f
...
...
@@ -13,8 +13,8 @@ Button {
text
:
"
Button
"
///< Pass in your own button text
checkable
:
true
height
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
checkable
:
true
implicitHeight
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
style
:
ButtonStyle
{
id
:
buttonStyle
...
...
@@ -30,6 +30,8 @@ Button {
id
:
innerRect
color
:
showHighlight
?
qgcPal
.
buttonHighlight
:
qgcPal
.
windowShade
implicitWidth
:
titleBar
.
x
+
titleBar
.
contentWidth
+
ScreenTools
.
defaultFontPixelWidth
QGCColoredImage
{
id
:
image
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
...
...
src/VehicleSetup/SetupView.qml
View file @
c1fee45f
...
...
@@ -213,24 +213,42 @@ Rectangle {
Flickable
{
id
:
buttonScroll
width
:
mainWindow
.
menuButtonW
idth
width
:
buttonColumn
.
w
idth
anchors.topMargin
:
_defaultTextHeight
/
2
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
clip
:
true
contentHeight
:
buttonColumn
.
height
contentWidth
:
parent
.
width
contentWidth
:
buttonColumn
.
width
boundsBehavior
:
Flickable
.
StopAtBounds
flickableDirection
:
Flickable
.
VerticalFlick
Column
{
id
:
buttonColumn
width
:
mainWindow
.
menu
ButtonWidth
width
:
_max
ButtonWidth
spacing
:
_defaultTextHeight
/
2
property
real
_maxButtonWidth
:
0
Component.onCompleted
:
reflowWidths
()
Connections
{
target
:
componentRepeater
onModelChanged
:
buttonColumn
.
reflowWidths
()
}
function
reflowWidths
()
{
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
_maxButtonWidth
=
Math
.
max
(
_maxButtonWidth
,
children
[
i
].
width
)
}
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
children
[
i
].
width
=
_maxButtonWidth
}
}
SubMenuButton
{
id
:
summaryButton
width
:
mainWindow
.
menuButtonWidth
imageResource
:
"
/qmlimages/VehicleSummaryIcon.png
"
setupIndicator
:
false
checked
:
true
...
...
@@ -242,7 +260,6 @@ Rectangle {
SubMenuButton
{
id
:
firmwareButton
width
:
mainWindow
.
menuButtonWidth
imageResource
:
"
/qmlimages/FirmwareUpgradeIcon.png
"
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
...
...
@@ -254,7 +271,6 @@ Rectangle {
SubMenuButton
{
id
:
px4FlowButton
width
:
mainWindow
.
menuButtonWidth
exclusiveGroup
:
setupButtonGroup
visible
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
genericFirmware
:
false
setupIndicator
:
false
...
...
@@ -264,7 +280,6 @@ Rectangle {
SubMenuButton
{
id
:
joystickButton
width
:
mainWindow
.
menuButtonWidth
setupIndicator
:
true
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
exclusiveGroup
:
setupButtonGroup
...
...
@@ -275,10 +290,10 @@ Rectangle {
}
Repeater
{
model
:
_fullParameterVehicleAvailable
?
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
:
0
id
:
componentRepeater
model
:
_fullParameterVehicleAvailable
?
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
:
0
SubMenuButton
{
width
:
mainWindow
.
menuButtonWidth
imageResource
:
modelData
.
iconResource
setupIndicator
:
modelData
.
requiresSetup
setupComplete
:
modelData
.
setupComplete
...
...
@@ -290,7 +305,6 @@ Rectangle {
}
SubMenuButton
{
width
:
mainWindow
.
menuButtonWidth
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
multiVehicleManager
.
parameterReadyVehicleAvailable
...
...
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