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
b30d4eb1
Commit
b30d4eb1
authored
Sep 12, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Font size based sizing and relative positioning fixes
parent
f19c3cfc
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
347 additions
and
390 deletions
+347
-390
AirframeComponent.qml
src/AutoPilotPlugins/PX4/AirframeComponent.qml
+50
-45
FlightModesComponent.qml
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
+26
-20
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+143
-176
SensorsComponent.qml
src/AutoPilotPlugins/PX4/SensorsComponent.qml
+34
-31
IndicatorButton.qml
src/QmlControls/IndicatorButton.qml
+11
-12
QGCView.qml
src/QmlControls/QGCView.qml
+5
-0
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+48
-56
VehicleSummary.qml
src/VehicleSetup/VehicleSummary.qml
+30
-50
No files found.
src/AutoPilotPlugins/PX4/AirframeComponent.qml
View file @
b30d4eb1
...
@@ -94,6 +94,8 @@ QGCView {
...
@@ -94,6 +94,8 @@ QGCView {
id
:
panel
id
:
panel
anchors.fill
:
parent
anchors.fill
:
parent
readonly
property
real
spacerHeight
:
ScreenTools
.
defaultFontPixelHeight
QGCLabel
{
QGCLabel
{
id
:
header
id
:
header
width
:
parent
.
width
width
:
parent
.
width
...
@@ -104,30 +106,36 @@ QGCView {
...
@@ -104,30 +106,36 @@ QGCView {
Item
{
Item
{
id
:
headingSpacer
id
:
headingSpacer
anchors.top
:
header
.
bottom
anchors.top
:
header
.
bottom
height
:
20
height
:
parent
.
spacerHeight
width
:
20
width
:
20
}
}
QGCLabel
{
Item
{
id
:
helpApplyRow
anchors.top
:
headingSpacer
.
bottom
anchors.top
:
headingSpacer
.
bottom
width
:
parent
.
width
-
applyButton
.
width
-
5
width
:
parent
.
width
text
:
"
Please select your airframe type. Click 'Apply and Restart' to reboot the autopilot. Please re-connect then manually.
"
height
:
Math
.
max
(
helpText
.
contentHeight
,
applyButton
.
height
)
wrapMode
:
Text
.
WordWrap
}
QGCButton
{
QGCLabel
{
id
:
applyButton
id
:
helpText
anchors.top
:
headingSpacer
.
bottom
width
:
parent
.
width
-
applyButton
.
width
-
5
anchors.right
:
parent
.
right
text
:
"
Please select your airframe type. Click 'Apply and Restart' to reboot the autopilot. Please re-connect then manually.
"
text
:
"
Apply and Restart
"
wrapMode
:
Text
.
WordWrap
}
onClicked
:
showDialog
(
applyRestartDialogComponent
,
"
Apply and Restart
"
,
50
,
StandardButton
.
Apply
|
StandardButton
.
Cancel
)
QGCButton
{
id
:
applyButton
anchors.right
:
parent
.
right
text
:
"
Apply and Restart
"
onClicked
:
showDialog
(
applyRestartDialogComponent
,
"
Apply and Restart
"
,
50
,
StandardButton
.
Apply
|
StandardButton
.
Cancel
)
}
}
}
Item
{
Item
{
id
:
lastSpacer
id
:
lastSpacer
anchors.top
:
applyButton
.
bottom
anchors.top
:
helpApplyRow
.
bottom
height
:
20
height
:
parent
.
spacerHeight
width
:
10
width
:
10
}
}
...
@@ -140,7 +148,7 @@ QGCView {
...
@@ -140,7 +148,7 @@ QGCView {
Flow
{
Flow
{
width
:
scroll
.
width
width
:
scroll
.
width
spacing
:
10
spacing
:
ScreenTools
.
defaultFontPixelWidth
ExclusiveGroup
{
ExclusiveGroup
{
id
:
airframeTypeExclusive
id
:
airframeTypeExclusive
...
@@ -152,16 +160,16 @@ QGCView {
...
@@ -152,16 +160,16 @@ QGCView {
// Outer summary item rectangle
// Outer summary item rectangle
Rectangle
{
Rectangle
{
id
:
airframeBackground
id
:
airframeBackground
readonly
property
real
titleHeight
:
30
width
:
ScreenTools
.
defaultFontPixelWidth
*
30
readonly
property
real
innerMargin
:
10
height
:
width
*
.
75
width
:
250
height
:
200
color
:
(
modelData
.
name
!=
controller
.
currentAirframeType
)
?
qgcPal
.
windowShade
:
qgcPal
.
buttonHighlight
color
:
(
modelData
.
name
!=
controller
.
currentAirframeType
)
?
qgcPal
.
windowShade
:
qgcPal
.
buttonHighlight
readonly
property
real
titleHeight
:
ScreenTools
.
defaultFontPixelHeight
*
1.75
readonly
property
real
innerMargin
:
ScreenTools
.
defaultFontPixelWidth
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
airframeCheckBox
.
checked
=
true
onClicked
:
airframeCheckBox
.
checked
=
true
}
}
Rectangle
{
Rectangle
{
...
@@ -170,36 +178,33 @@ QGCView {
...
@@ -170,36 +178,33 @@ QGCView {
height
:
parent
.
titleHeight
height
:
parent
.
titleHeight
color
:
qgcPal
.
windowShadeDark
color
:
qgcPal
.
windowShadeDark
Text
{
QGCLabel
{
anchors.fill
:
parent
anchors.fill
:
parent
color
:
qgcPal
.
buttonText
color
:
qgcPal
.
buttonText
font.pixelSize
:
12
text
:
modelData
.
name
verticalAlignment
:
TextEdit
.
AlignVCenter
verticalAlignment
:
TextEdit
.
AlignVCenter
horizontalAlignment
:
TextEdit
.
AlignHCenter
horizontalAlignment
:
TextEdit
.
AlignHCenter
text
:
modelData
.
name
}
}
}
}
Image
{
Image
{
id
:
image
id
:
image
x
:
innerMargin
width
:
parent
.
width
-
(
innerMargin
*
2
)
height
:
parent
.
height
-
title
.
height
-
combo
.
height
-
(
innerMargin
*
3
)
anchors.topMargin
:
innerMargin
anchors.topMargin
:
innerMargin
anchors.top
:
title
.
bottom
anchors.top
:
title
.
bottom
x
:
innerMargin
width
:
parent
.
width
-
(
innerMargin
*
2
)
height
:
parent
.
height
-
title
.
height
-
combo
.
height
-
(
innerMargin
*
3
)
fillMode
:
Image
.
PreserveAspectFit
smooth
:
true
source
:
modelData
.
imageResource
source
:
modelData
.
imageResource
fillMode
:
Image
.
PreserveAspectFit
smooth
:
true
}
}
QGCCheckBox
{
QGCCheckBox
{
id
:
airframeCheckBox
id
:
airframeCheckBox
anchors.bottom
:
image
.
bottom
anchors.bottom
:
image
.
bottom
anchors.right
:
image
.
right
anchors.right
:
image
.
right
checked
:
modelData
.
name
==
controller
.
currentAirframeType
checked
:
modelData
.
name
==
controller
.
currentAirframeType
exclusiveGroup
:
airframeTypeExclusive
exclusiveGroup
:
airframeTypeExclusive
...
@@ -214,14 +219,14 @@ QGCView {
...
@@ -214,14 +219,14 @@ QGCView {
}
}
QGCComboBox
{
QGCComboBox
{
id
:
combo
id
:
combo
objectName
:
modelData
.
airframeType
+
"
ComboBox
"
objectName
:
modelData
.
airframeType
+
"
ComboBox
"
x
:
innerMargin
x
:
innerMargin
anchors.topMargin
:
innerMargin
anchors.topMargin
:
innerMargin
anchors.top
:
image
.
bottom
anchors.top
:
image
.
bottom
width
:
parent
.
width
-
(
innerMargin
*
2
)
width
:
parent
.
width
-
(
innerMargin
*
2
)
model
:
modelData
.
airframes
currentIndex
:
(
modelData
.
name
==
controller
.
currentAirframeType
)
?
controller
.
currentVehicleIndex
:
-
1
currentIndex
:
(
modelData
.
name
==
controller
.
currentAirframeType
)
?
controller
.
currentVehicleIndex
:
-
1
model
:
modelData
.
airframes
onActivated
:
{
onActivated
:
{
if
(
index
!=
-
1
)
{
if
(
index
!=
-
1
)
{
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.qml
View file @
b30d4eb1
...
@@ -226,33 +226,39 @@ QGCView {
...
@@ -226,33 +226,39 @@ QGCView {
Item
{
Item
{
id
:
headingSpacer
id
:
headingSpacer
anchors.top
:
header
.
bottom
anchors.top
:
header
.
bottom
height
:
20
height
:
ScreenTools
.
defaultFontPixelHeight
width
:
20
width
:
20
}
}
QGCLabel
{
Item
{
anchors.top
:
headingSpacer
.
bottom
id
:
helpApplyRow
anchors.left
:
parent
.
left
anchors.top
:
headingSpacer
.
bottom
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
width
:
parent
.
width
anchors.right
:
applyButton
.
left
height
:
Math
.
max
(
helpText
.
contentHeight
,
applyButton
.
height
)
text
:
topHelpText
wrapMode
:
Text
.
WordWrap
QGCLabel
{
}
id
:
helpText
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
QGCButton
{
anchors.left
:
parent
.
left
id
:
applyButton
anchors.right
:
applyButton
.
left
anchors.top
:
headingSpacer
.
bottom
text
:
topHelpText
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
wrapMode
:
Text
.
WordWrap
anchors.right
:
parent
.
right
}
text
:
"
Generate Thresholds
"
QGCButton
{
onClicked
:
controller
.
generateThresholds
()
id
:
applyButton
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
right
text
:
"
Generate Thresholds
"
onClicked
:
controller
.
generateThresholds
()
}
}
}
Item
{
Item
{
id
:
lastSpacer
id
:
lastSpacer
anchors.top
:
applyButton
.
bottom
anchors.top
:
helpApplyRow
.
bottom
height
:
20
height
:
ScreenTools
.
defaultFontPixelHeight
width
:
10
width
:
10
}
}
...
...
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
b30d4eb1
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/PX4/SensorsComponent.qml
View file @
b30d4eb1
...
@@ -200,7 +200,7 @@ QGCView {
...
@@ -200,7 +200,7 @@ QGCView {
Column
{
Column
{
anchors.fill
:
parent
anchors.fill
:
parent
spacing
:
10
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGCLabel
{
QGCLabel
{
width
:
parent
.
width
width
:
parent
.
width
...
@@ -283,12 +283,12 @@ QGCView {
...
@@ -283,12 +283,12 @@ QGCView {
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
}
}
Item
{
height
:
20
;
width
:
10
}
// spacer
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
;
width
:
10
}
// spacer
Row
{
Row
{
readonly
property
int
buttonWidth
:
120
readonly
property
int
buttonWidth
:
ScreenTools
.
defaultFontPixelWidth
*
15
spacing
:
20
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
"
Calibrate:
"
;
anchors.baseline
:
compassButton
.
baseline
}
QGCLabel
{
text
:
"
Calibrate:
"
;
anchors.baseline
:
compassButton
.
baseline
}
...
@@ -367,17 +367,16 @@ QGCView {
...
@@ -367,17 +367,16 @@ QGCView {
}
}
}
}
Item
{
height
:
20
;
width
:
10
}
// spacer
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
;
width
:
10
}
// spacer
ProgressBar
{
ProgressBar
{
id
:
progressBar
id
:
progressBar
width
:
parent
.
width
-
rotationColumnWidth
width
:
parent
.
width
-
rotationColumnWidth
}
}
Item
{
height
:
10
;
width
:
10
}
// spacer
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
;
width
:
10
}
// spacer
Item
{
Item
{
readonly
property
int
calibrationAreaHeight
:
300
property
int
calDisplayAreaWidth
:
parent
.
width
-
rotationColumnWidth
property
int
calDisplayAreaWidth
:
parent
.
width
-
rotationColumnWidth
width
:
parent
.
width
width
:
parent
.
width
...
@@ -405,25 +404,22 @@ QGCView {
...
@@ -405,25 +404,22 @@ QGCView {
color
:
qgcPal
.
windowShade
color
:
qgcPal
.
windowShade
QGCLabel
{
QGCLabel
{
id
:
orientationCalAreaHelpText
id
:
orientationCalAreaHelpText
width
:
parent
.
width
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
wrapMode
:
Text
.
WordWrap
anchors.top
:
orientationCalArea
.
top
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
anchors.left
:
orientationCalArea
.
left
anchors.top
:
orientationCalArea
.
top
width
:
parent
.
width
anchors.left
:
orientationCalArea
.
left
wrapMode
:
Text
.
WordWrap
anchors.topMargin
:
15
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
anchors.leftMargin
:
15
anchors.rightMargin
:
15
anchors.bottomMargin
:
15
}
}
Flow
{
Flow
{
anchors.top
:
orientationCalAreaHelpText
.
bottom
anchors.top
Margin
:
ScreenTools
.
defaultFontPixelWidth
anchors.
left
:
orientationCalAreaHelpText
.
left
anchors.
top
:
orientationCalAreaHelpText
.
bottom
anchors.
topMargin
:
15
anchors.
left
:
orientationCalAreaHelpText
.
left
width
:
parent
.
width
width
:
parent
.
width
height
:
parent
.
height
-
orientationCalAreaHelpText
.
implicitHeight
height
:
parent
.
height
-
orientationCalAreaHelpText
.
implicitHeight
spacing
:
5
spacing
:
ScreenTools
.
defaultFontPixelWidth
VehicleRotationCal
{
VehicleRotationCal
{
visible
:
controller
.
orientationCalDownSideVisible
visible
:
controller
.
orientationCalDownSideVisible
...
@@ -471,13 +467,13 @@ QGCView {
...
@@ -471,13 +467,13 @@ QGCView {
}
}
Column
{
Column
{
anchors.left
:
orientationCalArea
.
right
anchors.left
Margin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
Margin
:
5
anchors.left
:
orientationCalArea
.
right
spacing
:
20
x
:
parent
.
width
-
rotationColumnWidth
x
:
parent
.
width
-
rotationColumn
Width
spacing
:
ScreenTools
.
defaultFontPixel
Width
Column
{
Column
{
spacing
:
5
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
QGCLabel
{
font.pixelSize
:
sideBarH1PointSize
font.pixelSize
:
sideBarH1PointSize
...
@@ -499,7 +495,7 @@ QGCView {
...
@@ -499,7 +495,7 @@ QGCView {
}
}
Column
{
Column
{
spacing
:
5
spacing
:
ScreenTools
.
defaultFontPixelWidth
// Compass 0 rotation
// Compass 0 rotation
Component
{
Component
{
...
@@ -510,6 +506,7 @@ QGCView {
...
@@ -510,6 +506,7 @@ QGCView {
text
:
"
External Compass Orientation
"
text
:
"
External Compass Orientation
"
}
}
}
}
Component
{
Component
{
id
:
compass0ComponentCombo2
id
:
compass0ComponentCombo2
...
@@ -520,12 +517,14 @@ QGCView {
...
@@ -520,12 +517,14 @@ QGCView {
fact
:
cal_mag0_rot
fact
:
cal_mag0_rot
}
}
}
}
Loader
{
sourceComponent
:
showCompass0Rot
?
compass0ComponentLabel2
:
null
}
Loader
{
sourceComponent
:
showCompass0Rot
?
compass0ComponentLabel2
:
null
}
Loader
{
sourceComponent
:
showCompass0Rot
?
compass0ComponentCombo2
:
null
}
Loader
{
sourceComponent
:
showCompass0Rot
?
compass0ComponentCombo2
:
null
}
}
}
Column
{
Column
{
spacing
:
5
spacing
:
ScreenTools
.
defaultFontPixelWidth
// Compass 1 rotation
// Compass 1 rotation
Component
{
Component
{
id
:
compass1ComponentLabel2
id
:
compass1ComponentLabel2
...
@@ -535,6 +534,7 @@ QGCView {
...
@@ -535,6 +534,7 @@ QGCView {
text
:
"
External Compass 1 Orientation
"
text
:
"
External Compass 1 Orientation
"
}
}
}
}
Component
{
Component
{
id
:
compass1ComponentCombo2
id
:
compass1ComponentCombo2
...
@@ -545,12 +545,14 @@ QGCView {
...
@@ -545,12 +545,14 @@ QGCView {
fact
:
cal_mag1_rot
fact
:
cal_mag1_rot
}
}
}
}
Loader
{
sourceComponent
:
showCompass1Rot
?
compass1ComponentLabel2
:
null
}
Loader
{
sourceComponent
:
showCompass1Rot
?
compass1ComponentLabel2
:
null
}
Loader
{
sourceComponent
:
showCompass1Rot
?
compass1ComponentCombo2
:
null
}
Loader
{
sourceComponent
:
showCompass1Rot
?
compass1ComponentCombo2
:
null
}
}
}
Column
{
Column
{
spacing
:
5
spacing
:
ScreenTools
.
defaultFontPixelWidth
// Compass 2 rotation
// Compass 2 rotation
Component
{
Component
{
id
:
compass2ComponentLabel2
id
:
compass2ComponentLabel2
...
@@ -560,6 +562,7 @@ QGCView {
...
@@ -560,6 +562,7 @@ QGCView {
text
:
"
Compass 2 Orientation
"
text
:
"
Compass 2 Orientation
"
}
}
}
}
Component
{
Component
{
id
:
compass2ComponentCombo2
id
:
compass2ComponentCombo2
...
...
src/QmlControls/IndicatorButton.qml
View file @
b30d4eb1
import
QtQuick
2.2
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
// An IndicatorButton works just like q QGCButton with the additional support or a red/green
// An IndicatorButton works just like q QGCButton with the additional support or a red/green
// indicator on the right edge.
// indicator on the right edge.
...
@@ -11,14 +12,12 @@ QGCButton {
...
@@ -11,14 +12,12 @@ QGCButton {
property
bool
indicatorGreen
:
false
property
bool
indicatorGreen
:
false
Rectangle
{
Rectangle
{
readonly
property
real
indicatorRadius
:
4
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
3
anchors.right
:
parent
.
right
x
:
parent
.
width
-
(
indicatorRadius
*
2
)
-
5
anchors.verticalCenter
:
parent
.
verticalCenter
y
:
(
parent
.
height
-
(
indicatorRadius
*
2
))
/
2
width
:
radius
*
2
width
:
indicatorRadius
*
2
height
:
width
height
:
indicatorRadius
*
2
radius
:
(
ScreenTools
.
defaultFontPixelHeight
*
.
75
)
/
2
color
:
indicatorGreen
?
"
#00d932
"
:
"
red
"
radius
:
indicatorRadius
color
:
indicatorGreen
?
"
#00d932
"
:
"
red
"
}
}
}
}
src/QmlControls/QGCView.qml
View file @
b30d4eb1
...
@@ -121,6 +121,11 @@ FactPanel {
...
@@ -121,6 +121,11 @@ FactPanel {
}
}
}
}
/// Shows a QGCViewDialog component
/// @param compoent QGCViewDialog component
/// @param title Title for dialog
/// @param charWidth Width of dialog in characters (-1 for full parent width)
/// @param buttons Buttons to show in dialog using StandardButton enum
function
showDialog
(
component
,
title
,
charWidth
,
buttons
)
{
function
showDialog
(
component
,
title
,
charWidth
,
buttons
)
{
if
(
__checkForEarlyDialog
())
{
if
(
__checkForEarlyDialog
())
{
return
return
...
...
src/QmlControls/SubMenuButton.qml
View file @
b30d4eb1
import
QtQuick
2.2
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtGraphicalEffects
1.0
import
QtGraphicalEffects
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
Button
{
Button
{
checkable
:
true
property
bool
setupComplete
:
true
///< true: setup complete indicator shows as completed
height
:
60
property
bool
setupIndicator
:
true
///< true: show setup complete indicator
property
string
imageResource
:
"
/qmlimages/subMenuButtonImage.png
"
///< Button image
text
:
"
Button
"
text
:
"
Button
"
///< Pass in your own button text
property
bool
setupComplete
:
true
property
bool
setupIndicator
:
true
checkable
:
true
property
string
imageResource
:
"
/qmlimages/subMenuButtonImage.png
"
height
:
ScreenTools
.
defaultFontPixelHeight
*
5
style
:
ButtonStyle
{
style
:
ButtonStyle
{
id
:
buttonStyle
id
:
buttonStyle
property
var
__qgcPal
:
QGCPalette
{
QGCPalette
{
colorGroupEnabled
:
control
.
enabled
id
:
qgcPal
colorGroupEnabled
:
control
.
enabled
}
}
property
bool
__
showHighlight
:
control
.
pressed
|
control
.
checked
property
bool
showHighlight
:
control
.
pressed
|
control
.
checked
background
:
Rectangle
{
background
:
Rectangle
{
id
:
innerRect
id
:
innerRect
readonly
property
real
titleHeight
:
20
color
:
showHighlight
?
qgcPal
.
buttonHighlight
:
qgcPal
.
button
color
:
__showHighlight
?
__qgcPal
.
buttonHighlight
:
__qgcPal
.
button
Text
{
id
:
titleBar
width
:
parent
.
width
readonly
property
real
titleHeight
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
parent
.
titleHeight
verticalAlignment
:
TextEdit
.
AlignVCenter
QGCLabel
{
horizontalAlignment
:
TextEdit
.
AlignHCenter
id
:
titleBar
width
:
parent
.
width
text
:
control
.
text
height
:
parent
.
titleHeight
font.pixelSize
:
ScreenTools
.
defaultFontPixelSize
verticalAlignment
:
TextEdit
.
AlignVCenter
antialiasing
:
true
horizontalAlignment
:
TextEdit
.
AlignHCenter
color
:
__showHighlight
?
__qgcPal
.
buttonHighlightText
:
__qgcPal
.
buttonText
color
:
showHighlight
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
text
:
control
.
text
Rectangle
{
Rectangle
{
id
:
setupIndicator
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
3
anchors.right
:
parent
.
right
readonly
property
real
indicatorRadius
:
4
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
radius
*
2
x
:
parent
.
width
-
(
indicatorRadius
*
2
)
-
3
height
:
width
y
:
(
parent
.
height
-
(
indicatorRadius
*
2
))
/
2
radius
:
indicatorRadius
width
:
indicatorRadius
*
2
color
:
control
.
setupComplete
?
"
#00d932
"
:
"
red
"
height
:
indicatorRadius
*
2
visible
:
control
.
setupIndicator
radius
:
indicatorRadius
readonly
property
real
indicatorRadius
:
(
ScreenTools
.
defaultFontPixelHeight
*
.
75
)
/
2
color
:
control
.
setupIndicator
?
(
control
.
setupComplete
?
"
#00d932
"
:
"
red
"
)
:
innerRect
.
color
}
}
}
}
Rectangle
{
Rectangle
{
width
:
parent
.
width
anchors.top
:
titleBar
.
bottom
height
:
parent
.
height
-
parent
.
titleHeight
anchors.bottom
:
parent
.
bottom
width
:
parent
.
width
y
:
parent
.
titleHeight
color
:
qgcPal
.
windowShade
color
:
__qgcPal
.
windowShade
QGCColoredImage
{
QGCColoredImage
{
source
:
control
.
imageResource
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
.
75
fillMode
:
Image
.
PreserveAspectFit
anchors.fill
:
parent
width
:
parent
.
width
-
20
fillMode
:
Image
.
PreserveAspectFit
height
:
parent
.
height
-
20
smooth
:
true
anchors.horizontalCenter
:
parent
.
horizontalCenter
color
:
showHighlight
?
qgcPal
.
buttonHighlight
:
qgcPal
.
button
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
control
.
imageResource
smooth
:
true
color
:
__showHighlight
?
__qgcPal
.
buttonHighlight
:
__qgcPal
.
button
}
}
}
}
}
}
label
:
Item
{}
label
:
Item
{}
}
}
}
}
src/VehicleSetup/VehicleSummary.qml
View file @
b30d4eb1
...
@@ -26,36 +26,28 @@ import QtQuick.Controls 1.2
...
@@ -26,36 +26,28 @@ import QtQuick.Controls 1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
Palette
1.0
Rectangle
{
Rectangle
{
width
:
600
height
:
400
property
var
qgcPal
:
QGCPalette
{
id
:
palette
;
colorGroupEnabled
:
true
}
id
:
topLevel
objectName
:
"
topLevel
"
color
:
qgcPal
.
window
color
:
qgcPal
.
window
QGCPalette
{
id
:
qgcPal
colorGroupEnabled
:
enabled
}
Column
{
Column
{
anchors.fill
:
parent
anchors.fill
:
parent
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGCLabel
{
QGCLabel
{
text
:
"
VEHICLE SUMMARY
"
text
:
"
VEHICLE SUMMARY
"
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
}
}
Item
{
// Just used as a spacer
height
:
15
width
:
10
}
QGCLabel
{
QGCLabel
{
width
:
parent
.
width
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
...
@@ -68,12 +60,6 @@ Rectangle {
...
@@ -68,12 +60,6 @@ Rectangle {
property
bool
setupComplete
:
multiVehicleManager
.
activeVehicle
.
autopilot
.
setupComplete
property
bool
setupComplete
:
multiVehicleManager
.
activeVehicle
.
autopilot
.
setupComplete
}
}
Item
{
// Just used as a spacer
height
:
20
width
:
10
}
Flow
{
Flow
{
width
:
parent
.
width
width
:
parent
.
width
spacing
:
ScreenTools
.
defaultFontPixelWidth
spacing
:
ScreenTools
.
defaultFontPixelWidth
...
@@ -84,54 +70,48 @@ Rectangle {
...
@@ -84,54 +70,48 @@ Rectangle {
// Outer summary item rectangle
// Outer summary item rectangle
Rectangle
{
Rectangle
{
readonly
property
real
titleHeight
:
ScreenTools
.
defaultFontPixelHeight
*
2
width
:
ScreenTools
.
defaultFontPixelWidth
*
28
width
:
ScreenTools
.
defaultFontPixelWidth
*
28
height
:
ScreenTools
.
defaultFontPixelHeight
*
13
height
:
ScreenTools
.
defaultFontPixelHeight
*
13
color
:
qgcPal
.
windowShade
color
:
qgcPal
.
windowShade
readonly
property
real
titleHeight
:
ScreenTools
.
defaultFontPixelHeight
*
2
// Title bar
// Title bar
Rectangle
{
Rectangle
{
id
:
titleBar
width
:
parent
.
width
width
:
parent
.
width
height
:
titleHeight
height
:
titleHeight
color
:
qgcPal
.
windowShadeDark
color
:
qgcPal
.
windowShadeDark
// Title text
// Title text
QGCLabel
{
QGCLabel
{
anchors.fill
:
parent
anchors.fill
:
parent
color
:
qgcPal
.
buttonText
text
:
modelData
.
name
.
toUpperCase
()
verticalAlignment
:
TextEdit
.
AlignVCenter
verticalAlignment
:
TextEdit
.
AlignVCenter
horizontalAlignment
:
TextEdit
.
AlignHCenter
horizontalAlignment
:
TextEdit
.
AlignHCenter
text
:
modelData
.
name
.
toUpperCase
()
}
}
}
// Setup indicator
// Setup indicator
Rectangle
{
Rectangle
{
readonly
property
real
indicatorRadius
:
6
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
/
3
readonly
property
real
indicatorRightInset
:
5
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
x
:
parent
.
width
-
(
indicatorRadius
*
2
)
-
indicatorRightInset
width
:
10
//radius * 2
y
:
(
parent
.
titleHeight
-
(
indicatorRadius
*
2
))
/
2
height
:
10
//height
width
:
indicatorRadius
*
2
radius
:
(
ScreenTools
.
defaultFontPixelHeight
*
.
75
)
*
2
height
:
indicatorRadius
*
2
color
:
modelData
.
setupComplete
?
"
#00d932
"
:
"
red
"
radius
:
indicatorRadius
visible
:
modelData
.
requiresSetup
color
:
modelData
.
setupComplete
?
"
#00d932
"
:
"
red
"
}
}
}
// Summary Qml
// Summary Qml
Rectangle
{
Rectangle
{
y
:
parent
.
titleHeight
anchors.top
:
titleBar
.
bottom
width
:
parent
.
width
width
:
parent
.
width
height
:
parent
.
height
-
parent
.
titleHeight
color
:
qgcPal
.
windowShade
Loader
{
Loader
{
anchors.fill
:
parent
anchors.fill
:
parent
source
:
modelData
.
summaryQmlSource
source
:
modelData
.
summaryQmlSource
}
}
}
}
}
}
...
...
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