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
de4f9cac
Commit
de4f9cac
authored
Mar 28, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toolbar/Instruments respect palette
Map control use different border color based on map type
parent
fd9e128e
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
315 additions
and
401 deletions
+315
-401
FactCheckBox.qml
src/FactSystem/FactControls/FactCheckBox.qml
+0
-2
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+24
-16
QGCInstrumentWidget.qml
src/FlightMap/Widgets/QGCInstrumentWidget.qml
+10
-6
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+25
-15
QGCApplication.cc
src/QGCApplication.cc
+1
-2
QGCPalette.cc
src/QGCPalette.cc
+13
-2
QGCPalette.h
src/QGCPalette.h
+9
-0
DropButton.qml
src/QmlControls/DropButton.qml
+1
-0
QGCToolBarButton.qml
src/QmlControls/QGCToolBarButton.qml
+40
-75
RoundButton.qml
src/QmlControls/RoundButton.qml
+9
-6
MainWindowInner.qml
src/ui/MainWindowInner.qml
+11
-10
MainWindowLeftPanel.qml
src/ui/MainWindowLeftPanel.qml
+6
-4
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+4
-8
MavlinkSettings.qml
src/ui/preferences/MavlinkSettings.qml
+2
-5
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+74
-173
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+74
-71
SignalStrength.qml
src/ui/toolbar/SignalStrength.qml
+12
-6
No files found.
src/FactSystem/FactControls/FactCheckBox.qml
View file @
de4f9cac
...
@@ -11,8 +11,6 @@ QGCCheckBox {
...
@@ -11,8 +11,6 @@ QGCCheckBox {
property
variant
checkedValue
:
1
property
variant
checkedValue
:
1
property
variant
uncheckedValue
:
0
property
variant
uncheckedValue
:
0
property
var
__qgcpal
:
QGCPalette
{
colorGroupEnabled
:
true
}
partiallyCheckedEnabled
:
fact
.
value
!=
checkedValue
&&
fact
.
value
!=
uncheckedValue
partiallyCheckedEnabled
:
fact
.
value
!=
checkedValue
&&
fact
.
value
!=
uncheckedValue
checkedState
:
fact
.
value
==
checkedValue
?
Qt
.
Checked
:
(
fact
.
value
==
uncheckedValue
?
Qt
.
Unchecked
:
Qt
.
PartiallyChecked
)
checkedState
:
fact
.
value
==
checkedValue
?
Qt
.
Checked
:
(
fact
.
value
==
uncheckedValue
?
Qt
.
Unchecked
:
Qt
.
PartiallyChecked
)
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
de4f9cac
...
@@ -41,11 +41,13 @@ Item {
...
@@ -41,11 +41,13 @@ Item {
property
alias
guidedModeBar
:
_guidedModeBar
property
alias
guidedModeBar
:
_guidedModeBar
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
property
bool
_lightWidgetBorders
:
_mainIsMap
?
(
_flightMap
?
_flightMap
.
isSatelliteMap
:
true
)
:
true
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
!
isBackgroundDark
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
!
isBackgroundDark
}
QGCPalette
{
id
:
qgcPal
}
function
getGadgetWidth
()
{
function
getGadgetWidth
()
{
if
(
ScreenTools
.
isMobile
)
{
if
(
ScreenTools
.
isMobile
)
{
...
@@ -111,7 +113,7 @@ Item {
...
@@ -111,7 +113,7 @@ Item {
pitchAngle
:
_pitch
pitchAngle
:
_pitch
groundSpeedFact
:
_groundSpeedFact
groundSpeedFact
:
_groundSpeedFact
airSpeedFact
:
_airSpeedFact
airSpeedFact
:
_airSpeedFact
isSatellite
:
_isSatellite
lightBorders
:
_lightWidgetBorders
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
qgcView
:
parent
.
parent
.
qgcView
qgcView
:
parent
.
parent
.
qgcView
maxHeight
:
parent
.
height
-
(
anchors
.
margins
*
2
)
maxHeight
:
parent
.
height
-
(
anchors
.
margins
*
2
)
...
@@ -162,6 +164,7 @@ Item {
...
@@ -162,6 +164,7 @@ Item {
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
dropDownComponent
:
Component
{
dropDownComponent
:
Component
{
Row
{
Row
{
...
@@ -203,6 +206,7 @@ Item {
...
@@ -203,6 +206,7 @@ Item {
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
dropDownComponent
:
Component
{
dropDownComponent
:
Component
{
Column
{
Column
{
...
@@ -247,6 +251,8 @@ Item {
...
@@ -247,6 +251,8 @@ Item {
buttonImage
:
"
/qmlimages/ZoomPlus.svg
"
buttonImage
:
"
/qmlimages/ZoomPlus.svg
"
exclusiveGroup
:
_dropButtonsExclusiveGroup
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
onClicked
:
{
onClicked
:
{
if
(
_flightMap
)
if
(
_flightMap
)
_flightMap
.
zoomLevel
+=
0.5
_flightMap
.
zoomLevel
+=
0.5
...
@@ -261,6 +267,8 @@ Item {
...
@@ -261,6 +267,8 @@ Item {
buttonImage
:
"
/qmlimages/ZoomMinus.svg
"
buttonImage
:
"
/qmlimages/ZoomMinus.svg
"
exclusiveGroup
:
_dropButtonsExclusiveGroup
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
onClicked
:
{
onClicked
:
{
if
(
_flightMap
)
if
(
_flightMap
)
_flightMap
.
zoomLevel
-=
0.5
_flightMap
.
zoomLevel
-=
0.5
...
@@ -278,7 +286,7 @@ Item {
...
@@ -278,7 +286,7 @@ Item {
width
:
guidedModeColumn
.
width
+
(
_margins
*
2
)
width
:
guidedModeColumn
.
width
+
(
_margins
*
2
)
height
:
guidedModeColumn
.
height
+
(
_margins
*
2
)
height
:
guidedModeColumn
.
height
+
(
_margins
*
2
)
radius
:
_margins
radius
:
_margins
color
:
qgcPal
.
window
color
:
_lightWidgetBorders
?
qgcPal
.
mapWidgetBorderLight
:
qgcPal
.
mapWidgetBorderDark
visible
:
_activeVehicle
visible
:
_activeVehicle
opacity
:
0.9
opacity
:
0.9
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
...
...
src/FlightMap/Widgets/QGCInstrumentWidget.qml
View file @
de4f9cac
...
@@ -34,6 +34,7 @@ import QGroundControl.Controls 1.0
...
@@ -34,6 +34,7 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FlightMap
1.0
import
QGroundControl
.
FlightMap
1.0
import
QGroundControl
.
Palette
1.0
Item
{
Item
{
id
:
instrumentPanel
id
:
instrumentPanel
...
@@ -44,7 +45,7 @@ Item {
...
@@ -44,7 +45,7 @@ Item {
property
alias
rollAngle
:
attitudeWidget
.
rollAngle
property
alias
rollAngle
:
attitudeWidget
.
rollAngle
property
alias
pitchAngle
:
attitudeWidget
.
pitchAngle
property
alias
pitchAngle
:
attitudeWidget
.
pitchAngle
property
real
size
:
_defaultSize
property
real
size
:
_defaultSize
property
bool
isSatellite
:
fals
e
property
bool
lightBorders
:
tru
e
property
bool
active
:
false
property
bool
active
:
false
property
var
qgcView
property
var
qgcView
property
real
maxHeight
property
real
maxHeight
...
@@ -55,7 +56,7 @@ Item {
...
@@ -55,7 +56,7 @@ Item {
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelSize
*
(
9
)
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelSize
*
(
9
)
property
color
_backgroundColor
:
isSatellite
?
Qt
.
rgba
(
1
,
1
,
1
,
0.75
)
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
property
color
_backgroundColor
:
qgcPal
.
window
property
real
_spacing
:
ScreenTools
.
defaultFontPixelSize
*
0.33
property
real
_spacing
:
ScreenTools
.
defaultFontPixelSize
*
0.33
property
real
_topBottomMargin
:
(
size
*
0.05
)
/
2
property
real
_topBottomMargin
:
(
size
*
0.05
)
/
2
property
real
_availableValueHeight
:
maxHeight
-
(
attitudeWidget
.
height
+
_spacer1
.
height
+
_spacer2
.
height
+
(
_spacing
*
4
))
-
(
_showCompass
?
compass
.
height
:
0
)
property
real
_availableValueHeight
:
maxHeight
-
(
attitudeWidget
.
height
+
_spacer1
.
height
+
_spacer2
.
height
+
(
_spacing
*
4
))
-
(
_showCompass
?
compass
.
height
:
0
)
...
@@ -63,12 +64,16 @@ Item {
...
@@ -63,12 +64,16 @@ Item {
readonly
property
bool
_showCompass
:
!
ScreenTools
.
isShortScreen
readonly
property
bool
_showCompass
:
!
ScreenTools
.
isShortScreen
QGCPalette
{
id
:
qgcPal
}
Rectangle
{
Rectangle
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
height
:
(
_showCompass
?
instrumentColumn
.
height
:
attitudeWidget
.
height
)
+
(
_topBottomMargin
*
2
)
height
:
(
_showCompass
?
instrumentColumn
.
height
:
attitudeWidget
.
height
)
+
(
_topBottomMargin
*
2
)
radius
:
size
/
2
radius
:
size
/
2
color
:
_backgroundColor
color
:
_backgroundColor
border.width
:
1
border.color
:
lightBorders
?
qgcPal
.
mapWidgetBorderLight
:
qgcPal
.
mapWidgetBorderDark
}
}
MouseArea
{
MouseArea
{
...
@@ -104,7 +109,6 @@ Item {
...
@@ -104,7 +109,6 @@ Item {
opacity
:
0.5
opacity
:
0.5
width
:
attitudeWidget
.
width
*
0.15
width
:
attitudeWidget
.
width
*
0.15
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
visible
:
_activeVehicle
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -120,7 +124,7 @@ Item {
...
@@ -120,7 +124,7 @@ Item {
id
:
_spacer1
id
:
_spacer1
height
:
1
height
:
1
width
:
parent
.
width
*
0.9
width
:
parent
.
width
*
0.9
color
:
isSatellite
?
Qt
.
rgba
(
0
,
0
,
0
,
0.25
)
:
Qt
.
rgba
(
1
,
1
,
1
,
0.25
)
color
:
qgcPal
.
text
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
...
@@ -139,7 +143,7 @@ Item {
...
@@ -139,7 +143,7 @@ Item {
id
:
_valuesWidget
id
:
_valuesWidget
width
:
parent
.
width
width
:
parent
.
width
qgcView
:
instrumentPanel
.
qgcView
qgcView
:
instrumentPanel
.
qgcView
textColor
:
isSatellite
?
"
black
"
:
"
white
"
textColor
:
qgcPal
.
text
backgroundColor
:
_backgroundColor
backgroundColor
:
_backgroundColor
maxHeight
:
_availableValueHeight
maxHeight
:
_availableValueHeight
}
}
...
@@ -149,7 +153,7 @@ Item {
...
@@ -149,7 +153,7 @@ Item {
id
:
_spacer2
id
:
_spacer2
height
:
1
height
:
1
width
:
parent
.
width
*
0.9
width
:
parent
.
width
*
0.9
color
:
isSatellite
?
Qt
.
rgba
(
0
,
0
,
0
,
0.25
)
:
Qt
.
rgba
(
1
,
1
,
1
,
0.25
)
color
:
qgcPal
.
text
visible
:
_showCompass
visible
:
_showCompass
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
...
...
src/MissionEditor/MissionEditor.qml
View file @
de4f9cac
...
@@ -64,6 +64,7 @@ QGCView {
...
@@ -64,6 +64,7 @@ QGCView {
property
var
_currentMissionItem
property
var
_currentMissionItem
property
bool
_firstVehiclePosition
:
true
property
bool
_firstVehiclePosition
:
true
property
var
activeVehiclePosition
:
_activeVehicle
?
_activeVehicle
.
coordinate
:
QtPositioning
.
coordinate
()
property
var
activeVehiclePosition
:
_activeVehicle
?
_activeVehicle
.
coordinate
:
QtPositioning
.
coordinate
()
property
bool
_lightWidgetBorders
:
editorMap
.
isSatelliteMap
onActiveVehiclePositionChanged
:
updateMapToVehiclePosition
()
onActiveVehiclePositionChanged
:
updateMapToVehiclePosition
()
...
@@ -527,6 +528,7 @@ QGCView {
...
@@ -527,6 +528,7 @@ QGCView {
id
:
addMissionItemsButton
id
:
addMissionItemsButton
buttonImage
:
"
/qmlimages/MapAddMission.svg
"
buttonImage
:
"
/qmlimages/MapAddMission.svg
"
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
}
}
RoundButton
{
RoundButton
{
...
@@ -534,6 +536,7 @@ QGCView {
...
@@ -534,6 +536,7 @@ QGCView {
buttonImage
:
"
/qmlimages/MapDrawShape.svg
"
buttonImage
:
"
/qmlimages/MapDrawShape.svg
"
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
visible
:
QGroundControl
.
experimentalSurvey
visible
:
QGroundControl
.
experimentalSurvey
lightBorders
:
_lightWidgetBorders
onClicked
:
{
onClicked
:
{
var
coordinate
=
editorMap
.
center
var
coordinate
=
editorMap
.
center
...
@@ -557,6 +560,7 @@ QGCView {
...
@@ -557,6 +560,7 @@ QGCView {
dropDownComponent
:
syncDropDownComponent
dropDownComponent
:
syncDropDownComponent
enabled
:
!
controller
.
syncInProgress
enabled
:
!
controller
.
syncInProgress
rotateImage
:
controller
.
syncInProgress
rotateImage
:
controller
.
syncInProgress
lightBorders
:
_lightWidgetBorders
}
}
DropButton
{
DropButton
{
...
@@ -566,6 +570,7 @@ QGCView {
...
@@ -566,6 +570,7 @@ QGCView {
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
dropDownComponent
:
Component
{
dropDownComponent
:
Component
{
Column
{
Column
{
...
@@ -615,6 +620,7 @@ QGCView {
...
@@ -615,6 +620,7 @@ QGCView {
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
exclusiveGroup
:
_dropButtonsExclusiveGroup
exclusiveGroup
:
_dropButtonsExclusiveGroup
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
dropDownComponent
:
Component
{
dropDownComponent
:
Component
{
Column
{
Column
{
...
@@ -650,6 +656,8 @@ QGCView {
...
@@ -650,6 +656,8 @@ QGCView {
visible
:
!
ScreenTools
.
isTinyScreen
&&
!
ScreenTools
.
isShortScreen
visible
:
!
ScreenTools
.
isTinyScreen
&&
!
ScreenTools
.
isShortScreen
buttonImage
:
"
/qmlimages/ZoomPlus.svg
"
buttonImage
:
"
/qmlimages/ZoomPlus.svg
"
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
onClicked
:
{
onClicked
:
{
if
(
editorMap
)
if
(
editorMap
)
editorMap
.
zoomLevel
+=
0.5
editorMap
.
zoomLevel
+=
0.5
...
@@ -663,6 +671,8 @@ QGCView {
...
@@ -663,6 +671,8 @@ QGCView {
visible
:
!
ScreenTools
.
isTinyScreen
&&
!
ScreenTools
.
isShortScreen
visible
:
!
ScreenTools
.
isTinyScreen
&&
!
ScreenTools
.
isShortScreen
buttonImage
:
"
/qmlimages/ZoomMinus.svg
"
buttonImage
:
"
/qmlimages/ZoomMinus.svg
"
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
lightBorders
:
_lightWidgetBorders
onClicked
:
{
onClicked
:
{
if
(
editorMap
)
if
(
editorMap
)
editorMap
.
zoomLevel
-=
0.5
editorMap
.
zoomLevel
-=
0.5
...
...
src/QGCApplication.cc
View file @
de4f9cac
...
@@ -656,13 +656,12 @@ void QGCApplication::_loadCurrentStyle(void)
...
@@ -656,13 +656,12 @@ void QGCApplication::_loadCurrentStyle(void)
}
}
if
(
success
&&
!
_styleIsDark
)
{
if
(
success
&&
!
_styleIsDark
)
{
qDebug
()
<<
"LOADING LIGHT"
;
// Load the slave light stylesheet.
// Load the slave light stylesheet.
QFile
styleSheet
(
_lightStyleFile
);
QFile
styleSheet
(
_lightStyleFile
);
if
(
styleSheet
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
if
(
styleSheet
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
styles
+=
styleSheet
.
readAll
();
styles
+=
styleSheet
.
readAll
();
}
else
{
}
else
{
q
Debu
g
()
<<
"Unable to load slave light sheet:"
;
q
Warnin
g
()
<<
"Unable to load slave light sheet:"
;
success
=
false
;
success
=
false
;
}
}
}
}
...
...
src/QGCPalette.cc
View file @
de4f9cac
...
@@ -59,7 +59,7 @@ QColor QGCPalette::_warningText[QGCPalette::_cThemes][QGCPalette::_cColorGroups]
...
@@ -59,7 +59,7 @@ QColor QGCPalette::_warningText[QGCPalette::_cThemes][QGCPalette::_cColorGroups]
};
};
QColor
QGCPalette
::
_button
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_button
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#ffffff"
),
QColor
(
"#
ffffff
"
)
},
{
QColor
(
"#ffffff"
),
QColor
(
"#
91d1e4
"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
98
,
98
,
100
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
98
,
98
,
100
)
},
};
};
...
@@ -69,7 +69,7 @@ QColor QGCPalette::_buttonText[QGCPalette::_cThemes][QGCPalette::_cColorGroups]
...
@@ -69,7 +69,7 @@ QColor QGCPalette::_buttonText[QGCPalette::_cThemes][QGCPalette::_cColorGroups]
};
};
QColor
QGCPalette
::
_buttonHighlight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
QColor
QGCPalette
::
_buttonHighlight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
"#e4e4e4"
),
QColor
(
"#
91d1e4
"
)
},
{
QColor
(
"#e4e4e4"
),
QColor
(
"#
33b5e5
"
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
237
,
235
,
51
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
237
,
235
,
51
)
},
};
};
...
@@ -108,6 +108,17 @@ QColor QGCPalette::_mapButtonHighlight[QGCPalette::_cThemes][QGCPalette::_cColor
...
@@ -108,6 +108,17 @@ QColor QGCPalette::_mapButtonHighlight[QGCPalette::_cThemes][QGCPalette::_cColor
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
190
,
120
,
28
)
},
{
QColor
(
0x58
,
0x58
,
0x58
),
QColor
(
190
,
120
,
28
)
},
};
};
// Map widget colors are not affecting by theming
QColor
QGCPalette
::
_mapWidgetBorderLight
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
255
,
255
,
255
),
QColor
(
255
,
255
,
255
)
},
{
QColor
(
255
,
255
,
255
),
QColor
(
255
,
255
,
255
)
},
};
QColor
QGCPalette
::
_mapWidgetBorderDark
[
QGCPalette
::
_cThemes
][
QGCPalette
::
_cColorGroups
]
=
{
{
QColor
(
0
,
0
,
0
),
QColor
(
0
,
0
,
0
)
},
{
QColor
(
0
,
0
,
0
),
QColor
(
0
,
0
,
0
)
},
};
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QGCPalette
::
QGCPalette
(
QObject
*
parent
)
:
QObject
(
parent
),
QObject
(
parent
),
_colorGroupEnabled
(
true
)
_colorGroupEnabled
(
true
)
...
...
src/QGCPalette.h
View file @
de4f9cac
...
@@ -80,6 +80,8 @@ class QGCPalette : public QObject
...
@@ -80,6 +80,8 @@ class QGCPalette : public QObject
Q_PROPERTY
(
QColor
textFieldText
READ
textFieldText
WRITE
setTextFieldText
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
textFieldText
READ
textFieldText
WRITE
setTextFieldText
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
mapButton
READ
mapButton
WRITE
setMapButton
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
mapButton
READ
mapButton
WRITE
setMapButton
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
mapButtonHighlight
READ
mapButtonHighlight
WRITE
setMapButtonHighlight
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
mapButtonHighlight
READ
mapButtonHighlight
WRITE
setMapButtonHighlight
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
mapWidgetBorderLight
READ
mapWidgetBorderLight
WRITE
setMapWidgetBorderLight
NOTIFY
paletteChanged
)
Q_PROPERTY
(
QColor
mapWidgetBorderDark
READ
mapWidgetBorderDark
WRITE
setMapWidgetBorderDark
NOTIFY
paletteChanged
)
public:
public:
enum
ColorGroup
{
enum
ColorGroup
{
...
@@ -113,6 +115,8 @@ public:
...
@@ -113,6 +115,8 @@ public:
QColor
textFieldText
(
void
)
const
{
return
_textFieldText
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
textFieldText
(
void
)
const
{
return
_textFieldText
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapButton
(
void
)
const
{
return
_mapButton
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapButton
(
void
)
const
{
return
_mapButton
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapButtonHighlight
(
void
)
const
{
return
_mapButtonHighlight
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapButtonHighlight
(
void
)
const
{
return
_mapButtonHighlight
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapWidgetBorderLight
(
void
)
const
{
return
_mapWidgetBorderLight
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
QColor
mapWidgetBorderDark
(
void
)
const
{
return
_mapWidgetBorderDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
];
}
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
();
}
...
@@ -129,6 +133,8 @@ public:
...
@@ -129,6 +133,8 @@ public:
void
setTextFieldText
(
QColor
&
color
)
{
_textFieldText
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setTextFieldText
(
QColor
&
color
)
{
_textFieldText
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapButton
(
QColor
&
color
)
{
_mapButton
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapButton
(
QColor
&
color
)
{
_mapButton
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapButtonHighlight
(
QColor
&
color
)
{
_mapButtonHighlight
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapButtonHighlight
(
QColor
&
color
)
{
_mapButtonHighlight
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapWidgetBorderLight
(
QColor
&
color
)
{
_mapWidgetBorderLight
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
void
setMapWidgetBorderDark
(
QColor
&
color
)
{
_mapWidgetBorderDark
[
_theme
][
_colorGroupEnabled
?
1
:
0
]
=
color
;
_signalPaletteChangeToAll
();
}
static
Theme
globalTheme
(
void
)
{
return
_theme
;
}
static
Theme
globalTheme
(
void
)
{
return
_theme
;
}
static
void
setGlobalTheme
(
Theme
newTheme
);
static
void
setGlobalTheme
(
Theme
newTheme
);
...
@@ -169,6 +175,9 @@ private:
...
@@ -169,6 +175,9 @@ private:
static
QColor
_mapButton
[
_cThemes
][
_cColorGroups
];
static
QColor
_mapButton
[
_cThemes
][
_cColorGroups
];
static
QColor
_mapButtonHighlight
[
_cThemes
][
_cColorGroups
];
static
QColor
_mapButtonHighlight
[
_cThemes
][
_cColorGroups
];
static
QColor
_mapWidgetBorderLight
[
_cThemes
][
_cColorGroups
];
static
QColor
_mapWidgetBorderDark
[
_cThemes
][
_cColorGroups
];
void
_themeChanged
(
void
);
void
_themeChanged
(
void
);
static
QList
<
QGCPalette
*>
_paletteObjects
;
///< List of all active QGCPalette objects
static
QList
<
QGCPalette
*>
_paletteObjects
;
///< List of all active QGCPalette objects
...
...
src/QmlControls/DropButton.qml
View file @
de4f9cac
...
@@ -15,6 +15,7 @@ Item {
...
@@ -15,6 +15,7 @@ Item {
property
int
dropDirection
:
dropDown
property
int
dropDirection
:
dropDown
property
alias
dropDownComponent
:
dropDownLoader
.
sourceComponent
property
alias
dropDownComponent
:
dropDownLoader
.
sourceComponent
property
real
viewportMargins
:
0
property
real
viewportMargins
:
0
property
alias
lightBorders
:
roundButton
.
lightBorders
width
:
radius
*
2
width
:
radius
*
2
height
:
radius
*
2
height
:
radius
*
2
...
...
src/QmlControls/QGCToolBarButton.qml
View file @
de4f9cac
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import
QtQuick
2.4
import
QtQuick
2.4
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QtGraphicalEffects
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
Item
{
Item
{
id
:
_root
id
:
_root
...
@@ -12,30 +36,30 @@ Item {
...
@@ -12,30 +36,30 @@ Item {
signal
clicked
()
signal
clicked
()
QGCPalette
{
id
:
qgcPal
}
onExclusiveGroupChanged
:
{
onExclusiveGroupChanged
:
{
if
(
exclusiveGroup
)
{
if
(
exclusiveGroup
)
{
exclusiveGroup
.
bindCheckable
(
_root
)
exclusiveGroup
.
bindCheckable
(
_root
)
}
}
}
}
Image
{
Rectangle
{
anchors.fill
:
parent
color
:
qgcPal
.
buttonHighlight
visible
:
checked
}
QGCColoredImage
{
id
:
icon
id
:
icon
width
:
parent
.
height
*
0.9
width
:
parent
.
height
*
0.9
height
:
parent
.
height
*
0.9
height
:
parent
.
height
*
0.9
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
visible
:
false
color
:
checked
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
ColorOverlay
{
id
:
iconOverlay
anchors.fill
:
icon
source
:
icon
color
:
(
checked
?
"
#e4e428
"
:
"
#ffffff
"
)
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
...
@@ -44,62 +68,3 @@ Item {
...
@@ -44,62 +68,3 @@ Item {
}
}
}
}
}
}
/*
QGCButton {
id: button
property bool repaintChevron: false
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool showHighlight: __showHighlight
style: ButtonStyle {
background: Item {
anchors.margins: height * 0.1 // 3
Canvas {
id: chevron
anchors.fill: parent
antialiasing: true
Connections {
target: button
onHoveredChanged: chevron.requestPaint()
onPressedChanged: chevron.requestPaint()
onCheckedChanged: chevron.requestPaint()
onShowHighlightChanged: chevron.requestPaint()
onRepaintChevronChanged: {
if(repaintChevron) {
chevron.requestPaint()
repaintChevron = false;
}
}
}
onPaint: {
var vMiddle = height / 2;
var context = getContext("2d");
var w12 = button.height * 0.4 // 12
var w3 = button.height * 0.1 // 3
var w15 = w12 + w3
context.reset();
context.beginPath();
context.lineWidth = button.height * 0.2; // 6
context.beginPath();
context.moveTo(0, 0);
context.lineTo(width - w15, 0);
context.lineTo(width - w3, vMiddle);
context.lineTo(width - w15, height);
context.lineTo(0, height);
context.closePath();
context.strokeStyle = __qgcPal.windowShade
context.fillStyle = showHighlight ? __qgcPal.buttonHighlight : (button.checked ? __qgcPal.buttonHighlight : __qgcPal.button);
context.stroke();
context.fill();
}
}
}
label: QGCLabel {
text: button.text
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: showHighlight ? __qgcPal.buttonHighlightText : (button.checked ? __qgcPal.primaryButtonText : __qgcPal.buttonText)
}
}
}
*/
src/QmlControls/RoundButton.qml
View file @
de4f9cac
...
@@ -12,6 +12,7 @@ Item {
...
@@ -12,6 +12,7 @@ Item {
property
alias
buttonImage
:
button
.
source
property
alias
buttonImage
:
button
.
source
property
real
radius
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
property
real
radius
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
property
bool
rotateImage
:
false
property
bool
rotateImage
:
false
property
bool
lightBorders
:
true
width
:
radius
*
2
width
:
radius
*
2
height
:
radius
*
2
height
:
radius
*
2
...
@@ -40,15 +41,17 @@ Item {
...
@@ -40,15 +41,17 @@ Item {
anchors.fill
:
parent
anchors.fill
:
parent
radius
:
width
/
2
radius
:
width
/
2
border.width
:
ScreenTools
.
defaultFontPixelHeight
*
0.0625
border.width
:
ScreenTools
.
defaultFontPixelHeight
*
0.0625
border.color
:
"
white
"
border.color
:
lightBorders
?
qgcPal
.
mapWidgetBorderLight
:
qgcPal
.
mapWidgetBorderDark
color
:
checked
?
qgcPal
.
mapButtonHighlight
:
qgcPal
.
mapB
utton
color
:
checked
?
qgcPal
.
buttonHighlight
:
qgcPal
.
b
utton
Image
{
QGCColored
Image
{
id
:
button
id
:
button
anchors.fill
:
parent
anchors.fill
:
parent
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
mipmap
:
true
smooth
:
true
smooth
:
true
color
:
checked
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
RotationAnimation
on
rotation
{
RotationAnimation
on
rotation
{
id
:
imageRotation
id
:
imageRotation
loops
:
Animation
.
Infinite
loops
:
Animation
.
Infinite
...
...
src/ui/MainWindowInner.qml
View file @
de4f9cac
...
@@ -42,7 +42,7 @@ Item {
...
@@ -42,7 +42,7 @@ Item {
readonly
property
string
_planViewSource
:
"
MissionEditor.qml
"
readonly
property
string
_planViewSource
:
"
MissionEditor.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
QGCPalette
{
id
:
__
qgcPal
;
colorGroupEnabled
:
true
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
property
real
tbHeight
:
ScreenTools
.
isMobile
?
(
ScreenTools
.
isTinyScreen
?
(
mainWindow
.
width
*
0.0666
)
:
(
mainWindow
.
width
*
0.05
))
:
ScreenTools
.
defaultFontPixelSize
*
4
property
real
tbHeight
:
ScreenTools
.
isMobile
?
(
ScreenTools
.
isTinyScreen
?
(
mainWindow
.
width
*
0.0666
)
:
(
mainWindow
.
width
*
0.05
))
:
ScreenTools
.
defaultFontPixelSize
*
4
property
int
tbCellHeight
:
tbHeight
*
0.75
property
int
tbCellHeight
:
tbHeight
*
0.75
...
@@ -401,7 +401,7 @@ Item {
...
@@ -401,7 +401,7 @@ Item {
width
:
mainWindow
.
width
*
0.55
width
:
mainWindow
.
width
*
0.55
height
:
ScreenTools
.
defaultFontPixelHeight
*
ScreenTools
.
fontHRatio
*
6
height
:
ScreenTools
.
defaultFontPixelHeight
*
ScreenTools
.
fontHRatio
*
6
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.8
)
color
:
qgcPal
.
window
visible
:
false
visible
:
false
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
@@ -425,6 +425,7 @@ Item {
...
@@ -425,6 +425,7 @@ Item {
boundsBehavior
:
Flickable
.
StopAtBounds
boundsBehavior
:
Flickable
.
StopAtBounds
pixelAligned
:
true
pixelAligned
:
true
clip
:
true
clip
:
true
TextEdit
{
TextEdit
{
id
:
criticalMessageText
id
:
criticalMessageText
width
:
criticalMmessageArea
.
width
-
criticalClose
.
width
-
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
width
:
criticalMmessageArea
.
width
-
criticalClose
.
width
-
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
...
@@ -433,12 +434,12 @@ Item {
...
@@ -433,12 +434,12 @@ Item {
textFormat
:
TextEdit
.
RichText
textFormat
:
TextEdit
.
RichText
font.weight
:
Font
.
DemiBold
font.weight
:
Font
.
DemiBold
wrapMode
:
TextEdit
.
WordWrap
wrapMode
:
TextEdit
.
WordWrap
color
:
"
#fdfd3b
"
color
:
qgcPal
.
warningText
}
}
}
}
//-- Dismiss Critical Message
//-- Dismiss Critical Message
Image
{
QGCColored
Image
{
id
:
criticalClose
id
:
criticalClose
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
...
@@ -447,8 +448,8 @@ Item {
...
@@ -447,8 +448,8 @@ Item {
height
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
source
:
"
/res/XDelete.svg
"
source
:
"
/res/XDelete.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
color
:
qgcPal
.
warningText
smooth
:
true
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
...
@@ -458,7 +459,7 @@ Item {
...
@@ -458,7 +459,7 @@ Item {
}
}
//-- More text below indicator
//-- More text below indicator
Image
{
QGCColored
Image
{
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
...
@@ -466,9 +467,9 @@ Item {
...
@@ -466,9 +467,9 @@ Item {
height
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
source
:
"
/res/ArrowDown.svg
"
source
:
"
/res/ArrowDown.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
visible
:
criticalMessageText
.
lineCount
>
5
visible
:
criticalMessageText
.
lineCount
>
5
color
:
qgcPal
.
warningText
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
...
...
src/ui/MainWindowLeftPanel.qml
View file @
de4f9cac
...
@@ -44,6 +44,8 @@ Item {
...
@@ -44,6 +44,8 @@ Item {
readonly
property
real
__closeButtonSize
:
ScreenTools
.
defaultFontPixelHeight
*
2
readonly
property
real
__closeButtonSize
:
ScreenTools
.
defaultFontPixelHeight
*
2
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
QGCPalette
{
id
:
qgcPal
}
onVisibleChanged
:
{
onVisibleChanged
:
{
//-- Unselect any selected button
//-- Unselect any selected button
panelActionGroup
.
current
=
null
panelActionGroup
.
current
=
null
...
@@ -106,7 +108,7 @@ Item {
...
@@ -106,7 +108,7 @@ Item {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
opacity
:
0.0
opacity
:
0.0
color
:
__
qgcPal
.
window
color
:
qgcPal
.
window
visible
:
__rightPanel
.
source
==
""
visible
:
__rightPanel
.
source
==
""
// Dismiss if clicked outside menu area
// Dismiss if clicked outside menu area
MouseArea
{
MouseArea
{
...
@@ -134,7 +136,7 @@ Item {
...
@@ -134,7 +136,7 @@ Item {
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
__topSeparator
.
bottom
anchors.top
:
__topSeparator
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
color
:
__
qgcPal
.
windowShadeDark
color
:
qgcPal
.
windowShadeDark
QGCFlickable
{
QGCFlickable
{
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -270,7 +272,7 @@ Item {
...
@@ -270,7 +272,7 @@ Item {
height
:
parent
.
height
-
toolBar
.
height
-
__topSeparator
.
height
height
:
parent
.
height
-
toolBar
.
height
-
__topSeparator
.
height
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
visible
:
__rightPanel
.
source
!=
""
visible
:
__rightPanel
.
source
!=
""
color
:
__
qgcPal
.
window
color
:
qgcPal
.
window
//-- Panel Contents
//-- Panel Contents
Loader
{
Loader
{
id
:
__rightPanel
id
:
__rightPanel
...
@@ -288,7 +290,7 @@ Item {
...
@@ -288,7 +290,7 @@ Item {
source
:
"
/res/XDelete.svg
"
source
:
"
/res/XDelete.svg
"
mipmap
:
true
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
color
:
__
qgcPal
.
text
color
:
qgcPal
.
text
width
:
parent
.
width
*
0.75
width
:
parent
.
width
*
0.75
height
:
parent
.
height
*
0.75
height
:
parent
.
height
*
0.75
anchors.centerIn
:
parent
anchors.centerIn
:
parent
...
...
src/ui/preferences/GeneralSettings.qml
View file @
de4f9cac
...
@@ -36,16 +36,13 @@ import QGroundControl.Palette 1.0
...
@@ -36,16 +36,13 @@ import QGroundControl.Palette 1.0
Rectangle
{
Rectangle
{
id
:
_generalRoot
id
:
_generalRoot
color
:
__
qgcPal
.
window
color
:
qgcPal
.
window
anchors.fill
:
parent
anchors.fill
:
parent
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
property
Fact
_percentRemainingAnnounce
:
QGroundControl
.
multiVehicleManager
.
disconnectedVehicle
.
battery
.
percentRemainingAnnounce
property
Fact
_percentRemainingAnnounce
:
QGroundControl
.
multiVehicleManager
.
disconnectedVehicle
.
battery
.
percentRemainingAnnounce
QGCPalette
{
QGCPalette
{
id
:
qgcPal
}
id
:
qgcPal
colorGroupEnabled
:
enabled
}
QGCFlickable
{
QGCFlickable
{
clip
:
true
clip
:
true
...
@@ -115,7 +112,7 @@ Rectangle {
...
@@ -115,7 +112,7 @@ Rectangle {
}
}
QGCLabel
{
QGCLabel
{
anchors.baseline
:
distance
UnitsCombo
.
baseline
anchors.baseline
:
speed
UnitsCombo
.
baseline
text
:
"
(requires reboot to take affect)
"
text
:
"
(requires reboot to take affect)
"
}
}
}
}
...
@@ -250,12 +247,11 @@ Rectangle {
...
@@ -250,12 +247,11 @@ Rectangle {
QGCComboBox
{
QGCComboBox
{
id
:
paletteCombo
id
:
paletteCombo
width
:
ScreenTools
.
defaultFontPixelWidth
*
16
width
:
ScreenTools
.
defaultFontPixelWidth
*
16
model
:
[
"
Dark
"
,
"
Light
"
]
model
:
[
"
Indoor
"
,
"
Outdoor
"
]
currentIndex
:
QGroundControl
.
isDarkStyle
?
0
:
1
currentIndex
:
QGroundControl
.
isDarkStyle
?
0
:
1
onActivated
:
{
onActivated
:
{
if
(
index
!=
-
1
)
{
if
(
index
!=
-
1
)
{
currentIndex
=
index
currentIndex
=
index
console
.
log
((
index
===
0
)
?
"
Now it's Dark
"
:
"
Now it's Light
"
)
QGroundControl
.
isDarkStyle
=
index
===
0
?
true
:
false
QGroundControl
.
isDarkStyle
=
index
===
0
?
true
:
false
}
}
}
}
...
...
src/ui/preferences/MavlinkSettings.qml
View file @
de4f9cac
...
@@ -35,13 +35,10 @@ import QGroundControl.Palette 1.0
...
@@ -35,13 +35,10 @@ import QGroundControl.Palette 1.0
Rectangle
{
Rectangle
{
id
:
__mavlinkRoot
id
:
__mavlinkRoot
color
:
__
qgcPal
.
window
color
:
qgcPal
.
window
anchors.fill
:
parent
anchors.fill
:
parent
QGCPalette
{
QGCPalette
{
id
:
qgcPal
}
id
:
qgcPal
colorGroupEnabled
:
enabled
}
QGCFlickable
{
QGCFlickable
{
clip
:
true
clip
:
true
...
...
src/ui/toolbar/MainToolBar.qml
View file @
de4f9cac
This diff is collapsed.
Click to expand it.
src/ui/toolbar/MainToolBarIndicators.qml
View file @
de4f9cac
...
@@ -30,10 +30,13 @@ import QtQuick.Dialogs 1.1
...
@@ -30,10 +30,13 @@ import QtQuick.Dialogs 1.1
import
QGroundControl
1.0
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
Row
{
Row
{
spacing
:
tbSpacing
*
2
spacing
:
tbSpacing
*
2
QGCPalette
{
id
:
qgcPal
}
function
getSatStrength
(
hdop
)
{
function
getSatStrength
(
hdop
)
{
if
(
hdop
<=
1.0
)
if
(
hdop
<=
1.0
)
return
100
return
100
...
@@ -99,23 +102,24 @@ Row {
...
@@ -99,23 +102,24 @@ Row {
id
:
criticalMessage
id
:
criticalMessage
anchors.fill
:
parent
anchors.fill
:
parent
visible
:
activeVehicle
?
(
activeVehicle
.
messageCount
>
0
&&
isMessageImportant
)
:
false
visible
:
activeVehicle
?
(
activeVehicle
.
messageCount
>
0
&&
isMessageImportant
)
:
false
Image
{
Image
{
source
:
"
/qmlimages/Yield.svg
"
source
:
"
/qmlimages/Yield.svg
"
height
:
mainWindow
.
tbCellHeight
*
0.75
height
:
mainWindow
.
tbCellHeight
*
0.75
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
cache
:
false
cache
:
false
visible
:
isMessageImportant
visible
:
isMessageImportant
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
SequentialAnimation
{
SequentialAnimation
{
id
:
loopAnimation
id
:
loopAnimation
loops
:
Animation
.
Infinite
loops
:
Animation
.
Infinite
NumberAnimation
{
target
:
criticalMessage
;
property
:
"
opacity
"
;
duration
:
1000
;
from
:
0.25
;
to
:
1
}
NumberAnimation
{
target
:
criticalMessage
;
property
:
"
opacity
"
;
duration
:
1000
;
from
:
0.25
;
to
:
1
}
NumberAnimation
{
target
:
criticalMessage
;
property
:
"
opacity
"
;
duration
:
1000
;
from
:
1
;
to
:
0.25
}
NumberAnimation
{
target
:
criticalMessage
;
property
:
"
opacity
"
;
duration
:
1000
;
from
:
1
;
to
:
0.25
}
}
}
onVisibleChanged
:
{
onVisibleChanged
:
{
if
(
messages
.
visible
)
{
if
(
messages
.
visible
)
{
loopAnimation
.
start
()
loopAnimation
.
start
()
...
@@ -128,22 +132,16 @@ Row {
...
@@ -128,22 +132,16 @@ Row {
Item
{
Item
{
anchors.fill
:
parent
anchors.fill
:
parent
visible
:
!
criticalMessage
.
visible
visible
:
!
criticalMessage
.
visible
Image
{
QGCColoredImage
{
id
:
messageIcon
id
:
messageIcon
source
:
"
/qmlimages/Megaphone.svg
"
source
:
"
/qmlimages/Megaphone.svg
"
height
:
mainWindow
.
tbCellHeight
*
0.5
height
:
mainWindow
.
tbCellHeight
*
0.5
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
color
:
getMessageColor
()
smooth
:
true
visible
:
false
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
ColorOverlay
{
anchors.fill
:
messageIcon
source
:
messageIcon
color
:
getMessageColor
()
}
}
}
MouseArea
{
MouseArea
{
...
@@ -163,32 +161,35 @@ Row {
...
@@ -163,32 +161,35 @@ Row {
Row
{
Row
{
id
:
gpsRow
id
:
gpsRow
height
:
parent
.
height
height
:
parent
.
height
Image
{
QGCColoredImage
{
id
:
gpsIcon
id
:
gpsIcon
source
:
"
/qmlimages/Gps.svg
"
source
:
"
/qmlimages/Gps.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
width
:
mainWindow
.
tbCellHeight
*
0.65
width
:
mainWindow
.
tbCellHeight
*
0.65
height
:
mainWindow
.
tbCellHeight
*
0.5
height
:
mainWindow
.
tbCellHeight
*
0.5
opacity
:
(
activeVehicle
&&
activeVehicle
.
gps
.
count
.
value
>=
0
)
?
1
:
0.5
opacity
:
(
activeVehicle
&&
activeVehicle
.
gps
.
count
.
value
>=
0
)
?
1
:
0.5
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
SignalStrength
{
SignalStrength
{
size
:
mainWindow
.
tbCellHeight
*
0.5
size
:
mainWindow
.
tbCellHeight
*
0.5
percent
:
activeVehicle
?
getSatStrength
(
activeVehicle
.
gps
.
hdop
.
value
)
:
""
percent
:
activeVehicle
?
getSatStrength
(
activeVehicle
.
gps
.
hdop
.
value
)
:
""
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
}
QGCLabel
{
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
gps
.
hdop
.
valueString
:
""
visible
:
activeVehicle
&&
!
isNaN
(
activeVehicle
.
gps
.
hdop
.
value
)
font.pixelSize
:
tbFontSmall
color
:
colorWhite
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.leftMargin
:
gpsIcon
.
width
anchors.leftMargin
:
gpsIcon
.
width
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
visible
:
activeVehicle
&&
!
isNaN
(
activeVehicle
.
gps
.
hdop
.
value
)
font.pixelSize
:
tbFontSmall
color
:
qgcPal
.
buttonText
text
:
activeVehicle
?
activeVehicle
.
gps
.
hdop
.
valueString
:
""
}
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
...
@@ -204,25 +205,28 @@ Row {
...
@@ -204,25 +205,28 @@ Row {
id
:
rcRssi
id
:
rcRssi
width
:
rssiRow
.
width
*
1.1
width
:
rssiRow
.
width
*
1.1
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
Row
{
Row
{
id
:
rssiRow
id
:
rssiRow
height
:
parent
.
height
height
:
parent
.
height
Image
{
source
:
"
/qmlimages/RC.svg
"
QGCColoredImage
{
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
width
:
mainWindow
.
tbCellHeight
*
0.65
width
:
mainWindow
.
tbCellHeight
*
0.65
height
:
mainWindow
.
tbCellHeight
*
0.5
height
:
mainWindow
.
tbCellHeight
*
0.5
source
:
"
/qmlimages/RC.svg
"
fillMode
:
Image
.
PreserveAspectFit
opacity
:
activeVehicle
?
(
activeVehicle
.
rcRSSI
<
1
?
0.5
:
1
)
:
0.5
opacity
:
activeVehicle
?
(
activeVehicle
.
rcRSSI
<
1
?
0.5
:
1
)
:
0.5
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
SignalStrength
{
SignalStrength
{
size
:
mainWindow
.
tbCellHeight
*
0.5
size
:
mainWindow
.
tbCellHeight
*
0.5
percent
:
activeVehicle
?
activeVehicle
.
rcRSSI
:
0
percent
:
activeVehicle
?
activeVehicle
.
rcRSSI
:
0
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
...
@@ -239,23 +243,17 @@ Row {
...
@@ -239,23 +243,17 @@ Row {
width
:
telemIcon
.
width
width
:
telemIcon
.
width
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
visible
:
_controller
.
telemetryLRSSI
<
0
visible
:
_controller
.
telemetryLRSSI
<
0
Image
{
QGCColoredImage
{
id
:
telemIcon
id
:
telemIcon
source
:
"
/qmlimages/TelemRSSI.svg
"
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
height
:
parent
.
height
*
0.5
height
:
parent
.
height
*
0.5
width
:
height
*
1.5
width
:
height
*
1.5
visible
:
false
source
:
"
/qmlimages/TelemRSSI.svg
"
fillMode
:
Image
.
PreserveAspectFit
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
ColorOverlay
{
id
:
telemOverlay
anchors.fill
:
telemIcon
source
:
telemIcon
color
:
getRSSIColor
(
_controller
.
telemetryLRSSI
)
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
...
@@ -272,18 +270,20 @@ Row {
...
@@ -272,18 +270,20 @@ Row {
width
:
battRow
.
width
*
1.1
width
:
battRow
.
width
*
1.1
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
opacity
:
(
activeVehicle
&&
activeVehicle
.
battery
.
voltage
.
value
>=
0
)
?
1
:
0.5
opacity
:
(
activeVehicle
&&
activeVehicle
.
battery
.
voltage
.
value
>=
0
)
?
1
:
0.5
Row
{
Row
{
id
:
battRow
id
:
battRow
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
Image
{
QGCColoredImage
{
height
:
mainWindow
.
tbCellHeight
*
0.65
source
:
"
/qmlimages/Battery.svg
"
source
:
"
/qmlimages/Battery.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
color
:
qgcPal
.
buttonText
smooth
:
true
height
:
mainWindow
.
tbCellHeight
*
0.65
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
QGCLabel
{
QGCLabel
{
text
:
getBatteryPercentageText
()
text
:
getBatteryPercentageText
()
font.pixelSize
:
tbFontLarge
font.pixelSize
:
tbFontLarge
...
@@ -291,6 +291,7 @@ Row {
...
@@ -291,6 +291,7 @@ Row {
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
...
@@ -363,24 +364,26 @@ Row {
...
@@ -363,24 +364,26 @@ Row {
width
:
selectorRow
.
width
*
1.1
width
:
selectorRow
.
width
*
1.1
height
:
mainWindow
.
tbCellHeight
height
:
mainWindow
.
tbCellHeight
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
Row
{
Row
{
id
:
selectorRow
id
:
selectorRow
spacing
:
tbSpacing
spacing
:
tbSpacing
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
Image
{
QGCColoredImage
{
width
:
mainWindow
.
tbCellHeight
*
0.65
width
:
mainWindow
.
tbCellHeight
*
0.65
height
:
mainWindow
.
tbCellHeight
*
0.65
height
:
mainWindow
.
tbCellHeight
*
0.65
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
source
:
"
/qmlimages/Quad.svg
"
source
:
"
/qmlimages/Quad.svg
"
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
QGCLabel
{
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
flightMode
:
"
N/A
"
text
:
activeVehicle
?
activeVehicle
.
flightMode
:
"
N/A
"
font.pixelSize
:
tbFontLarge
font.pixelSize
:
tbFontLarge
color
:
colorWhite
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
}
...
...
src/ui/toolbar/SignalStrength.qml
View file @
de4f9cac
...
@@ -28,14 +28,20 @@ This file is part of the QGROUNDCONTROL project
...
@@ -28,14 +28,20 @@ This file is part of the QGROUNDCONTROL project
*/
*/
import
QtQuick
2.4
import
QtQuick
2.4
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
Item
{
Item
{
id
:
signalRoot
id
:
signalRoot
property
real
size
:
50
property
real
percent
:
0
width
:
size
width
:
size
height
:
size
height
:
size
property
real
size
:
50
property
real
percent
:
0
QGCPalette
{
id
:
qgcPal
}
function
getIcon
()
{
function
getIcon
()
{
if
(
percent
<
20
)
if
(
percent
<
20
)
return
"
/qmlimages/Signal0.svg
"
return
"
/qmlimages/Signal0.svg
"
...
@@ -49,11 +55,11 @@ Item {
...
@@ -49,11 +55,11 @@ Item {
return
"
/qmlimages/Signal80.svg
"
return
"
/qmlimages/Signal80.svg
"
return
"
/qmlimages/Signal100.svg
"
return
"
/qmlimages/Signal100.svg
"
}
}
Image
{
QGCColoredImage
{
source
:
getIcon
()
source
:
getIcon
()
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
anchors.fill
:
parent
anchors.fill
:
parent
color
:
qgcPal
.
buttonText
}
}
}
}
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