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 {
...
@@ -13,8 +13,8 @@ Button {
text
:
"
Button
"
///< Pass in your own button text
text
:
"
Button
"
///< Pass in your own button text
checkable
:
true
checkable
:
true
height
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
implicitHeight
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
style
:
ButtonStyle
{
style
:
ButtonStyle
{
id
:
buttonStyle
id
:
buttonStyle
...
@@ -30,6 +30,8 @@ Button {
...
@@ -30,6 +30,8 @@ Button {
id
:
innerRect
id
:
innerRect
color
:
showHighlight
?
qgcPal
.
buttonHighlight
:
qgcPal
.
windowShade
color
:
showHighlight
?
qgcPal
.
buttonHighlight
:
qgcPal
.
windowShade
implicitWidth
:
titleBar
.
x
+
titleBar
.
contentWidth
+
ScreenTools
.
defaultFontPixelWidth
QGCColoredImage
{
QGCColoredImage
{
id
:
image
id
:
image
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
...
...
src/VehicleSetup/SetupView.qml
View file @
c1fee45f
...
@@ -213,24 +213,42 @@ Rectangle {
...
@@ -213,24 +213,42 @@ Rectangle {
Flickable
{
Flickable
{
id
:
buttonScroll
id
:
buttonScroll
width
:
mainWindow
.
menuButtonW
idth
width
:
buttonColumn
.
w
idth
anchors.topMargin
:
_defaultTextHeight
/
2
anchors.topMargin
:
_defaultTextHeight
/
2
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
clip
:
true
clip
:
true
contentHeight
:
buttonColumn
.
height
contentHeight
:
buttonColumn
.
height
contentWidth
:
parent
.
width
contentWidth
:
buttonColumn
.
width
boundsBehavior
:
Flickable
.
StopAtBounds
boundsBehavior
:
Flickable
.
StopAtBounds
flickableDirection
:
Flickable
.
VerticalFlick
flickableDirection
:
Flickable
.
VerticalFlick
Column
{
Column
{
id
:
buttonColumn
id
:
buttonColumn
width
:
mainWindow
.
menu
ButtonWidth
width
:
_max
ButtonWidth
spacing
:
_defaultTextHeight
/
2
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
{
SubMenuButton
{
id
:
summaryButton
id
:
summaryButton
width
:
mainWindow
.
menuButtonWidth
imageResource
:
"
/qmlimages/VehicleSummaryIcon.png
"
imageResource
:
"
/qmlimages/VehicleSummaryIcon.png
"
setupIndicator
:
false
setupIndicator
:
false
checked
:
true
checked
:
true
...
@@ -242,7 +260,6 @@ Rectangle {
...
@@ -242,7 +260,6 @@ Rectangle {
SubMenuButton
{
SubMenuButton
{
id
:
firmwareButton
id
:
firmwareButton
width
:
mainWindow
.
menuButtonWidth
imageResource
:
"
/qmlimages/FirmwareUpgradeIcon.png
"
imageResource
:
"
/qmlimages/FirmwareUpgradeIcon.png
"
setupIndicator
:
false
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
exclusiveGroup
:
setupButtonGroup
...
@@ -254,7 +271,6 @@ Rectangle {
...
@@ -254,7 +271,6 @@ Rectangle {
SubMenuButton
{
SubMenuButton
{
id
:
px4FlowButton
id
:
px4FlowButton
width
:
mainWindow
.
menuButtonWidth
exclusiveGroup
:
setupButtonGroup
exclusiveGroup
:
setupButtonGroup
visible
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
genericFirmware
:
false
visible
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
genericFirmware
:
false
setupIndicator
:
false
setupIndicator
:
false
...
@@ -264,7 +280,6 @@ Rectangle {
...
@@ -264,7 +280,6 @@ Rectangle {
SubMenuButton
{
SubMenuButton
{
id
:
joystickButton
id
:
joystickButton
width
:
mainWindow
.
menuButtonWidth
setupIndicator
:
true
setupIndicator
:
true
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
exclusiveGroup
:
setupButtonGroup
exclusiveGroup
:
setupButtonGroup
...
@@ -275,10 +290,10 @@ Rectangle {
...
@@ -275,10 +290,10 @@ Rectangle {
}
}
Repeater
{
Repeater
{
model
:
_fullParameterVehicleAvailable
?
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
:
0
id
:
componentRepeater
model
:
_fullParameterVehicleAvailable
?
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
:
0
SubMenuButton
{
SubMenuButton
{
width
:
mainWindow
.
menuButtonWidth
imageResource
:
modelData
.
iconResource
imageResource
:
modelData
.
iconResource
setupIndicator
:
modelData
.
requiresSetup
setupIndicator
:
modelData
.
requiresSetup
setupComplete
:
modelData
.
setupComplete
setupComplete
:
modelData
.
setupComplete
...
@@ -290,7 +305,6 @@ Rectangle {
...
@@ -290,7 +305,6 @@ Rectangle {
}
}
SubMenuButton
{
SubMenuButton
{
width
:
mainWindow
.
menuButtonWidth
setupIndicator
:
false
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
exclusiveGroup
:
setupButtonGroup
visible
:
multiVehicleManager
.
parameterReadyVehicleAvailable
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