Commit e926ce69 authored by DonLakeFlyer's avatar DonLakeFlyer

Core plugin can set app wide brand image

parent 74766ba8
......@@ -37,8 +37,11 @@ public:
Q_PROPERTY(int defaultSettings READ defaultSettings CONSTANT)
Q_PROPERTY(QGCOptions* options READ options CONSTANT)
Q_PROPERTY(bool showTouchAreas MEMBER _showTouchAreas NOTIFY showTouchAreasChanged)
Q_PROPERTY(bool showAdvancedUI MEMBER _showAdvancedUI NOTIFY showAdvancedUIChanged)
Q_PROPERTY(bool showTouchAreas MEMBER _showTouchAreas NOTIFY showTouchAreasChanged)
Q_PROPERTY(bool showAdvancedUI MEMBER _showAdvancedUI NOTIFY showAdvancedUIChanged)
Q_PROPERTY(QString brandImageIndoor READ brandImageIndoor CONSTANT)
Q_PROPERTY(QString brandImageOutdoor READ brandImageIndoor CONSTANT)
/// The list of settings under the Settings Menu
/// @return A list of QGCSettings
......@@ -62,6 +65,12 @@ public:
/// @return true: Setting should be visible in ui, false: Setting should not be shown in ui
virtual bool adjustSettingMetaData (FactMetaData& metaData);
/// Return the resource file which contains the brand image for for Indoor theme.
virtual QString brandImageIndoor(void) const { return QString(); }
/// Return the resource file which contains the brand image for for Outdoor theme.
virtual QString brandImageOutdoor(void) const { return QString(); }
// Override from QGCTool
void setToolbox (QGCToolbox *toolbox);
......
......@@ -230,17 +230,6 @@ Rectangle {
anchors.top: parent.top
anchors.bottom: parent.bottom
Layout.fillWidth: true
visible: _activeVehicle
}
QGCLabel {
id: waitForVehicle
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Waiting For Vehicle Connection")
font.pointSize: ScreenTools.mediumFontPointSize
font.family: ScreenTools.demiboldFontFamily
color: colorRed
visible: !_activeVehicle
}
}
......
......@@ -19,19 +19,31 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
Item {
property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool communicationLost: activeVehicle ? activeVehicle.connectionLost : false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false
QGCPalette { id: qgcPal }
QGCLabel {
id: waitForVehicle
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Waiting For Vehicle Connection")
font.pointSize: ScreenTools.mediumFontPointSize
font.family: ScreenTools.demiboldFontFamily
color: colorRed
visible: !_activeVehicle
}
Row {
id: indicatorRow
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: ScreenTools.defaultFontPixelWidth * 1.5
visible: !communicationLost
visible: _activeVehicle && !_communicationLost
Repeater {
model: activeVehicle ? activeVehicle.toolBarIndicators : []
model: _activeVehicle ? _activeVehicle.toolBarIndicators : []
Loader {
anchors.top: parent.top
anchors.bottom: parent.bottom
......@@ -44,23 +56,28 @@ Item {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
visible: x > indicatorRow.width && !communicationLost
visible: x > indicatorRow.width && !_communicationLost
fillMode: Image.PreserveAspectFit
source: activeVehicle ? activeVehicle.brandImage : ""
source: _outdoorPalette ? _brandImageOutdoor : _brandImageIndoor
property bool _outdoorPalette: qgcPal.globalTheme === QGCPalette.Light
property bool _corePluginBranding: QGroundControl.corePlugin.brandImageIndoor.length != 0
property string _brandImageIndoor: _corePluginBranding ? QGroundControl.corePlugin.brandImageIndoor : (_activeVehicle ? _activeVehicle.brandImageIndoor : "")
property string _brandImageOutdoor: _corePluginBranding ? QGroundControl.corePlugin.brandImageOutdoor : (_activeVehicle ? _activeVehicle.brandImageOutdoor : "")
}
Row {
anchors.fill: parent
layoutDirection: Qt.RightToLeft
spacing: ScreenTools.defaultFontPixelWidth
visible: communicationLost
visible: _communicationLost
QGCButton {
id: disconnectButton
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Disconnect")
primary: true
onClicked: activeVehicle.disconnectInactiveVehicle()
onClicked: _activeVehicle.disconnectInactiveVehicle()
}
QGCLabel {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment