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
3a8b8099
Commit
3a8b8099
authored
Mar 10, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ColumnLayout so manual reflow not needed
parent
c980c331
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
94 deletions
+60
-94
SetupView.qml
src/VehicleSetup/SetupView.qml
+50
-72
AppSettings.qml
src/ui/AppSettings.qml
+10
-22
No files found.
src/VehicleSetup/SetupView.qml
View file @
3a8b8099
...
...
@@ -7,13 +7,9 @@
*
****************************************************************************/
/// @file
/// @brief Setup View
/// @author Don Gagne <don@thegagnes.com>
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
AutoPilotPlugin
1.0
...
...
@@ -217,36 +213,10 @@ Rectangle {
flickableDirection
:
Flickable
.
VerticalFlick
clip
:
true
Column
{
Column
Layout
{
id
:
buttonColumn
width
:
_maxButtonWidth
spacing
:
_defaultTextHeight
/
2
property
real
_maxButtonWidth
:
0
Component.onCompleted
:
reflowWidths
()
Connections
{
target
:
componentRepeater
onModelChanged
:
buttonColumn
.
reflowWidths
()
}
// I don't know why this does not work
Connections
{
target
:
QGroundControl
.
settingsManager
.
appSettings
.
appFontPointSize
onValueChanged
:
buttonColumn
.
reflowWidths
()
}
function
reflowWidths
()
{
buttonColumn
.
_maxButtonWidth
=
0
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
buttonColumn
.
_maxButtonWidth
=
Math
.
max
(
buttonColumn
.
_maxButtonWidth
,
children
[
i
].
width
)
}
for
(
var
j
=
0
;
j
<
children
.
length
;
j
++
)
{
children
[
j
].
width
=
buttonColumn
.
_maxButtonWidth
}
}
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -257,7 +227,7 @@ Rectangle {
}
Repeater
{
model
:
QGroundControl
.
corePlugin
.
settings
model
:
QGroundControl
.
corePlugin
.
settings
Pages
visible
:
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
SubMenuButton
{
imageResource
:
modelData
.
icon
...
...
@@ -266,6 +236,7 @@ Rectangle {
text
:
modelData
.
title
visible
:
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
panelLoader
.
setSource
(
modelData
.
url
)
Layout.fillWidth
:
true
}
}
...
...
@@ -276,6 +247,7 @@ Rectangle {
checked
:
true
exclusiveGroup
:
setupButtonGroup
text
:
"
Summary
"
Layout.fillWidth
:
true
onClicked
:
showSummaryPanel
()
}
...
...
@@ -287,6 +259,7 @@ Rectangle {
exclusiveGroup
:
setupButtonGroup
visible
:
!
ScreenTools
.
isMobile
text
:
"
Firmware
"
Layout.fillWidth
:
true
onClicked
:
showFirmwarePanel
()
}
...
...
@@ -297,6 +270,8 @@ Rectangle {
visible
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
genericFirmware
:
false
setupIndicator
:
false
text
:
"
PX4Flow
"
Layout.fillWidth
:
true
onClicked
:
showPX4FlowPanel
()
}
...
...
@@ -307,6 +282,7 @@ Rectangle {
exclusiveGroup
:
setupButtonGroup
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!=
0
text
:
"
Joystick
"
Layout.fillWidth
:
true
onClicked
:
showJoystickPanel
()
}
...
...
@@ -322,6 +298,7 @@ Rectangle {
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
name
visible
:
modelData
.
setupSource
.
toString
()
!=
""
Layout.fillWidth
:
true
onClicked
:
showVehicleComponentPanel
(
modelData
)
}
...
...
@@ -332,6 +309,7 @@ Rectangle {
exclusiveGroup
:
setupButtonGroup
visible
:
QGroundControl
.
multiVehicleManager
.
parameterReadyVehicleAvailable
text
:
"
Parameters
"
Layout.fillWidth
:
true
onClicked
:
showParametersPanel
()
}
...
...
src/ui/AppSettings.qml
View file @
3a8b8099
...
...
@@ -10,12 +10,11 @@
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
Qt
Positioning
5.3
import
Qt
Quick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FlightDisplay
1.0
import
QGroundControl
.
ScreenTools
1.0
Rectangle
{
...
...
@@ -28,7 +27,6 @@ Rectangle {
readonly
property
real
_horizontalMargin
:
_defaultTextWidth
/
2
readonly
property
real
_verticalMargin
:
_defaultTextHeight
/
2
readonly
property
real
_buttonHeight
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
3
:
ScreenTools
.
defaultFontPixelHeight
*
2
readonly
property
real
_buttonWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10
property
bool
_first
:
true
...
...
@@ -36,7 +34,7 @@ Rectangle {
Component.onCompleted
:
{
//-- Default Settings
__rightPanel
.
source
=
QGroundControl
.
corePlugin
.
settings
[
QGroundControl
.
corePlugin
.
defaultSettings
].
url
__rightPanel
.
source
=
QGroundControl
.
corePlugin
.
settings
Pages
[
QGroundControl
.
corePlugin
.
defaultSettings
].
url
}
QGCFlickable
{
...
...
@@ -53,25 +51,12 @@ Rectangle {
ExclusiveGroup
{
id
:
panelActionGroup
}
Column
{
Column
Layout
{
id
:
buttonColumn
width
:
_maxButtonWidth
spacing
:
_verticalMargin
property
real
_maxButtonWidth
:
0
Component.onCompleted
:
reflowWidths
()
function
reflowWidths
()
{
buttonColumn
.
_maxButtonWidth
=
0
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
buttonColumn
.
_maxButtonWidth
=
Math
.
max
(
buttonColumn
.
_maxButtonWidth
,
children
[
i
].
width
)
}
for
(
var
j
=
0
;
j
<
children
.
length
;
j
++
)
{
children
[
j
].
width
=
buttonColumn
.
_maxButtonWidth
}
}
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -82,17 +67,20 @@ Rectangle {
}
Repeater
{
model
:
QGroundControl
.
corePlugin
.
settings
model
:
QGroundControl
.
corePlugin
.
settings
Pages
QGCButton
{
height
:
_buttonHeight
text
:
modelData
.
title
exclusiveGroup
:
panelActionGroup
Layout.fillWidth
:
true
onClicked
:
{
if
(
__rightPanel
.
source
!==
modelData
.
url
)
{
__rightPanel
.
source
=
modelData
.
url
}
checked
=
true
}
Component.onCompleted
:
{
if
(
_first
)
{
_first
=
false
...
...
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