Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f2009786
Commit
f2009786
authored
Mar 18, 2017
by
Gus Grubba
Committed by
GitHub
Mar 18, 2017
Browse files
Merge pull request #4793 from dogmaphobic/toolBar
Eliminating dependencies from MainToolBar
parents
019e06d4
c62c006b
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/FlightDisplay/FlightDisplayView.qml
View file @
f2009786
...
...
@@ -245,7 +245,7 @@ QGCView {
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
qgcView
:
root
isBackgroundDark
:
root
.
isBackgroundDark
useLightColors
:
isBackgroundDark
visible
:
singleVehicleView
.
checked
}
...
...
@@ -302,14 +302,14 @@ QGCView {
z
:
_panel
.
z
+
5
width
:
parent
.
width
-
(
_flightVideoPipControl
.
width
/
2
)
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.bottomMargin
:
ScreenTools
.
defaultFontPixelHeight
*
2
anchors.horizontalCenter
:
flightDisplayViewWidgets
.
horizontalCenter
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
}
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
f2009786
...
...
@@ -28,7 +28,7 @@ Item {
property
alias
guidedModeBar
:
_guidedModeBar
property
bool
gotoEnabled
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
property
var
qgcView
property
bool
isBackgroundDark
property
bool
useLightColors
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_isSatellite
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
...
...
@@ -36,7 +36,7 @@ Item {
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
isBackgroundDark
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
useLightColors
}
QGCPalette
{
id
:
qgcPal
}
function
getPreferredInstrumentWidth
()
{
...
...
src/QGCPalette.h
View file @
f2009786
...
...
@@ -60,6 +60,13 @@ class QGCPalette : public QObject
Q_PROPERTY
(
QColor
brandingPurple
READ
brandingPurple
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:
enum
ColorGroup
{
Disabled
=
0
,
...
...
@@ -135,6 +142,13 @@ public:
/// Blue color from branding guidelines
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
setWindowShade
(
QColor
&
color
)
{
_windowShade
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setWindowShadeDark
(
QColor
&
color
)
{
_windowShadeDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
...
...
src/ui/MainWindowInner.qml
View file @
f2009786
...
...
@@ -259,7 +259,6 @@ Item {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
isBackgroundDark
:
flightView
.
isBackgroundDark
z
:
QGroundControl
.
zOrderTopMost
Component.onCompleted
:
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
...
...
src/ui/toolbar/BatteryIndicator.qml
View file @
f2009786
...
...
@@ -33,13 +33,13 @@ Item {
return
qgcPal
.
text
}
if
(
_activeVehicle
.
battery
.
percentRemaining
.
value
>
50
)
{
return
colorOrange
return
qgcPal
.
colorOrange
}
if
(
_activeVehicle
.
battery
.
percentRemaining
.
value
>
0.1
)
{
return
colorRed
return
qgcPal
.
colorRed
}
}
return
colorGrey
return
qgcPal
.
colorGrey
}
function
getBatteryPercentageText
()
{
...
...
src/ui/toolbar/MainToolBar.qml
View file @
f2009786
...
...
@@ -24,17 +24,7 @@ Rectangle {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
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
"
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
signal
showSettingsView
signal
showSetupView
...
...
@@ -74,7 +64,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
height
:
1
color
:
"
black
"
visible
:
qgcPal
.
globalTheme
==
QGCPalette
.
Light
visible
:
qgcPal
.
globalTheme
==
=
QGCPalette
.
Light
}
RowLayout
{
...
...
@@ -217,7 +207,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
height
:
toolBar
.
height
*
0.05
width
:
_activeVehicle
?
_activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
color
:
colorGreen
color
:
qgcPal
.
colorGreen
}
}
src/ui/toolbar/MainToolBarIndicators.qml
View file @
f2009786
...
...
@@ -53,7 +53,7 @@ Item {
text
:
qsTr
(
"
Waiting For Vehicle Connection
"
)
font.pointSize
:
ScreenTools
.
mediumFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
colorRed
color
:
qgcPal
.
colorRed
visible
:
!
_activeVehicle
}
...
...
@@ -108,7 +108,7 @@ Item {
text
:
qsTr
(
"
COMMUNICATION LOST
"
)
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
colorRed
color
:
qgcPal
.
colorRed
}
}
}
src/ui/toolbar/MessageIndicator.qml
View file @
f2009786
...
...
@@ -25,18 +25,19 @@ Item {
anchors.top
:
parent
.
top
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
()
{
if
(
_activeVehicle
)
{
if
(
_activeVehicle
.
messageTypeNone
)
return
colorGrey
return
qgcPal
.
colorGrey
if
(
_activeVehicle
.
messageTypeNormal
)
return
colorBlue
;
return
qgcPal
.
colorBlue
;
if
(
_activeVehicle
.
messageTypeWarning
)
return
colorOrange
;
return
qgcPal
.
colorOrange
;
if
(
_activeVehicle
.
messageTypeError
)
return
colorRed
;
return
qgcPal
.
colorRed
;
// Cannot be so make make it obnoxious to show error
console
.
log
(
"
Invalid vehicle message type
"
)
return
"
purple
"
;
...
...
@@ -52,7 +53,7 @@ Item {
sourceSize.height
:
height
fillMode
:
Image
.
PreserveAspectFit
cache
:
false
visible
:
_activeVehicle
&&
_activeVehicle
.
messageCount
>
0
&&
isMessageImportant
visible
:
_activeVehicle
&&
_activeVehicle
.
messageCount
>
0
&&
_
isMessageImportant
}
QGCColoredImage
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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