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
c62c006b
Commit
c62c006b
authored
Mar 18, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminating dependencies from MainToolBar
parent
019e06d4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
31 deletions
+35
-31
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+4
-4
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+2
-2
QGCPalette.h
src/QGCPalette.h
+14
-0
MainWindowInner.qml
src/ui/MainWindowInner.qml
+0
-1
BatteryIndicator.qml
src/ui/toolbar/BatteryIndicator.qml
+3
-3
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+3
-13
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+2
-2
MessageIndicator.qml
src/ui/toolbar/MessageIndicator.qml
+7
-6
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
c62c006b
...
@@ -245,7 +245,7 @@ QGCView {
...
@@ -245,7 +245,7 @@ QGCView {
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
qgcView
:
root
qgcView
:
root
isBackgroundDark
:
root
.
isBackgroundDark
useLightColors
:
isBackgroundDark
visible
:
singleVehicleView
.
checked
visible
:
singleVehicleView
.
checked
}
}
...
@@ -302,14 +302,14 @@ QGCView {
...
@@ -302,14 +302,14 @@ QGCView {
z
:
_panel
.
z
+
5
z
:
_panel
.
z
+
5
width
:
parent
.
width
-
(
_flightVideoPipControl
.
width
/
2
)
width
:
parent
.
width
-
(
_flightVideoPipControl
.
width
/
2
)
height
:
Math
.
min
(
ScreenTools
.
availableHeight
*
0.25
,
ScreenTools
.
defaultFontPixelWidth
*
16
)
height
:
Math
.
min
(
ScreenTools
.
availableHeight
*
0.25
,
ScreenTools
.
defaultFontPixelWidth
*
16
)
visible
:
_virtualJoystick
.
valu
e
visible
:
_virtualJoystick
?
_virtualJoystick
.
value
:
fals
e
anchors.bottom
:
_flightVideoPipControl
.
top
anchors.bottom
:
_flightVideoPipControl
.
top
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelHeight
*
2
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelHeight
*
2
anchors.horizontalCenter
:
flightDisplayViewWidgets
.
horizontalCenter
anchors.horizontalCenter
:
flightDisplayViewWidgets
.
horizontalCenter
source
:
"
qrc:/qml/VirtualJoystick.qml
"
source
:
"
qrc:/qml/VirtualJoystick.qml
"
active
:
_virtualJoystick
.
valu
e
active
:
_virtualJoystick
?
_virtualJoystick
.
value
:
fals
e
property
bool
useLightColors
:
root
.
isBackgroundDark
property
bool
useLightColors
:
isBackgroundDark
property
Fact
_virtualJoystick
:
QGroundControl
.
settingsManager
.
appSettings
.
virtualJoystick
property
Fact
_virtualJoystick
:
QGroundControl
.
settingsManager
.
appSettings
.
virtualJoystick
}
}
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
c62c006b
...
@@ -28,7 +28,7 @@ Item {
...
@@ -28,7 +28,7 @@ Item {
property
alias
guidedModeBar
:
_guidedModeBar
property
alias
guidedModeBar
:
_guidedModeBar
property
bool
gotoEnabled
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
property
bool
gotoEnabled
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
property
var
qgcView
property
var
qgcView
property
bool
isBackgroundDark
property
bool
useLightColors
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_isSatellite
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
property
bool
_isSatellite
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
...
@@ -36,7 +36,7 @@ Item {
...
@@ -36,7 +36,7 @@ Item {
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
isBackgroundDark
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
useLightColors
}
QGCPalette
{
id
:
qgcPal
}
QGCPalette
{
id
:
qgcPal
}
function
getPreferredInstrumentWidth
()
{
function
getPreferredInstrumentWidth
()
{
...
...
src/QGCPalette.h
View file @
c62c006b
...
@@ -60,6 +60,13 @@ class QGCPalette : public QObject
...
@@ -60,6 +60,13 @@ class QGCPalette : public QObject
Q_PROPERTY
(
QColor
brandingPurple
READ
brandingPurple
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
brandingPurple
READ
brandingPurple
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
brandingBlue
READ
brandingBlue
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
brandingBlue
READ
brandingBlue
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
colorGreen
READ
colorGreen
CONSTANT
)
Q_PROPERTY
(
QColor
colorOrange
READ
colorOrange
CONSTANT
)
Q_PROPERTY
(
QColor
colorRed
READ
colorRed
CONSTANT
)
Q_PROPERTY
(
QColor
colorGrey
READ
colorGrey
CONSTANT
)
Q_PROPERTY
(
QColor
colorBlue
READ
colorBlue
CONSTANT
)
Q_PROPERTY
(
QColor
colorWhite
READ
colorWhite
CONSTANT
)
public:
public:
enum
ColorGroup
{
enum
ColorGroup
{
Disabled
=
0
,
Disabled
=
0
,
...
@@ -135,6 +142,13 @@ public:
...
@@ -135,6 +142,13 @@ public:
/// Blue color from branding guidelines
/// Blue color from branding guidelines
QColor
brandingBlue
(
void
)
const
{
return
_brandingBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
brandingBlue
(
void
)
const
{
return
_brandingBlue
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
colorGreen
()
{
return
QColor
(
"#05f068"
);
}
QColor
colorOrange
()
{
return
QColor
(
"#f0ab06"
);
}
QColor
colorRed
()
{
return
QColor
(
"#fc4638"
);
}
QColor
colorGrey
()
{
return
QColor
(
"#7f7f7f"
);
}
QColor
colorBlue
()
{
return
QColor
(
"#636efe"
);
}
QColor
colorWhite
()
{
return
QColor
(
"#ffffff"
);
}
void
setWindow
(
QColor
&
color
)
{
_window
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindow
(
QColor
&
color
)
{
_window
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShade
(
QColor
&
color
)
{
_windowShade
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShade
(
QColor
&
color
)
{
_windowShade
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShadeDark
(
QColor
&
color
)
{
_windowShadeDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShadeDark
(
QColor
&
color
)
{
_windowShadeDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
...
...
src/ui/MainWindowInner.qml
View file @
c62c006b
...
@@ -259,7 +259,6 @@ Item {
...
@@ -259,7 +259,6 @@ Item {
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
isBackgroundDark
:
flightView
.
isBackgroundDark
z
:
QGroundControl
.
zOrderTopMost
z
:
QGroundControl
.
zOrderTopMost
Component.onCompleted
:
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
Component.onCompleted
:
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
...
...
src/ui/toolbar/BatteryIndicator.qml
View file @
c62c006b
...
@@ -33,13 +33,13 @@ Item {
...
@@ -33,13 +33,13 @@ Item {
return
qgcPal
.
text
return
qgcPal
.
text
}
}
if
(
_activeVehicle
.
battery
.
percentRemaining
.
value
>
50
)
{
if
(
_activeVehicle
.
battery
.
percentRemaining
.
value
>
50
)
{
return
colorOrange
return
qgcPal
.
colorOrange
}
}
if
(
_activeVehicle
.
battery
.
percentRemaining
.
value
>
0.1
)
{
if
(
_activeVehicle
.
battery
.
percentRemaining
.
value
>
0.1
)
{
return
colorRed
return
qgcPal
.
colorRed
}
}
}
}
return
colorGrey
return
qgcPal
.
colorGrey
}
}
function
getBatteryPercentageText
()
{
function
getBatteryPercentageText
()
{
...
...
src/ui/toolbar/MainToolBar.qml
View file @
c62c006b
...
@@ -24,17 +24,7 @@ Rectangle {
...
@@ -24,17 +24,7 @@ Rectangle {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
isMessageImportant
:
_activeVehicle
?
!
_activeVehicle
.
messageTypeNormal
&&
!
_activeVehicle
.
messageTypeNone
:
false
property
bool
isBackgroundDark
:
true
property
bool
opaqueBackground
:
false
readonly
property
color
colorGreen
:
"
#05f068
"
readonly
property
color
colorOrange
:
"
#f0ab06
"
readonly
property
color
colorRed
:
"
#fc4638
"
readonly
property
color
colorGrey
:
"
#7f7f7f
"
readonly
property
color
colorBlue
:
"
#636efe
"
readonly
property
color
colorWhite
:
"
#ffffff
"
signal
showSettingsView
signal
showSettingsView
signal
showSetupView
signal
showSetupView
...
@@ -74,7 +64,7 @@ Rectangle {
...
@@ -74,7 +64,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
height
:
1
height
:
1
color
:
"
black
"
color
:
"
black
"
visible
:
qgcPal
.
globalTheme
==
QGCPalette
.
Light
visible
:
qgcPal
.
globalTheme
==
=
QGCPalette
.
Light
}
}
RowLayout
{
RowLayout
{
...
@@ -217,7 +207,7 @@ Rectangle {
...
@@ -217,7 +207,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
height
:
toolBar
.
height
*
0.05
height
:
toolBar
.
height
*
0.05
width
:
_activeVehicle
?
_activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
width
:
_activeVehicle
?
_activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
color
:
colorGreen
color
:
qgcPal
.
colorGreen
}
}
}
}
src/ui/toolbar/MainToolBarIndicators.qml
View file @
c62c006b
...
@@ -53,7 +53,7 @@ Item {
...
@@ -53,7 +53,7 @@ Item {
text
:
qsTr
(
"
Waiting For Vehicle Connection
"
)
text
:
qsTr
(
"
Waiting For Vehicle Connection
"
)
font.pointSize
:
ScreenTools
.
mediumFontPointSize
font.pointSize
:
ScreenTools
.
mediumFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
colorRed
color
:
qgcPal
.
colorRed
visible
:
!
_activeVehicle
visible
:
!
_activeVehicle
}
}
...
@@ -108,7 +108,7 @@ Item {
...
@@ -108,7 +108,7 @@ Item {
text
:
qsTr
(
"
COMMUNICATION LOST
"
)
text
:
qsTr
(
"
COMMUNICATION LOST
"
)
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
colorRed
color
:
qgcPal
.
colorRed
}
}
}
}
}
}
src/ui/toolbar/MessageIndicator.qml
View file @
c62c006b
...
@@ -25,18 +25,19 @@ Item {
...
@@ -25,18 +25,19 @@ Item {
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_isMessageImportant
:
_activeVehicle
?
!
_activeVehicle
.
messageTypeNormal
&&
!
_activeVehicle
.
messageTypeNone
:
false
function
getMessageColor
()
{
function
getMessageColor
()
{
if
(
_activeVehicle
)
{
if
(
_activeVehicle
)
{
if
(
_activeVehicle
.
messageTypeNone
)
if
(
_activeVehicle
.
messageTypeNone
)
return
colorGrey
return
qgcPal
.
colorGrey
if
(
_activeVehicle
.
messageTypeNormal
)
if
(
_activeVehicle
.
messageTypeNormal
)
return
colorBlue
;
return
qgcPal
.
colorBlue
;
if
(
_activeVehicle
.
messageTypeWarning
)
if
(
_activeVehicle
.
messageTypeWarning
)
return
colorOrange
;
return
qgcPal
.
colorOrange
;
if
(
_activeVehicle
.
messageTypeError
)
if
(
_activeVehicle
.
messageTypeError
)
return
colorRed
;
return
qgcPal
.
colorRed
;
// Cannot be so make make it obnoxious to show error
// Cannot be so make make it obnoxious to show error
console
.
log
(
"
Invalid vehicle message type
"
)
console
.
log
(
"
Invalid vehicle message type
"
)
return
"
purple
"
;
return
"
purple
"
;
...
@@ -52,7 +53,7 @@ Item {
...
@@ -52,7 +53,7 @@ Item {
sourceSize.height
:
height
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
cache
:
false
cache
:
false
visible
:
_activeVehicle
&&
_activeVehicle
.
messageCount
>
0
&&
isMessageImportant
visible
:
_activeVehicle
&&
_activeVehicle
.
messageCount
>
0
&&
_
isMessageImportant
}
}
QGCColoredImage
{
QGCColoredImage
{
...
...
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