Commit 9ee95420 authored by Gus Grubba's avatar Gus Grubba

Custom multi vehicle indicators/selectors

parent 33fbd552
...@@ -61,7 +61,7 @@ Button { ...@@ -61,7 +61,7 @@ Button {
width: height width: height
sourceSize.height: parent.height sourceSize.height: parent.height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
color: qgcPal.buttonText color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
source: "/qmlimages/PaperPlane.svg" source: "/qmlimages/PaperPlane.svg"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
...@@ -71,13 +71,13 @@ Button { ...@@ -71,13 +71,13 @@ Button {
QGCLabel { QGCLabel {
text: qsTr("Vehicle ") + (vehicle ? vehicle.id : qsTr("None")) text: qsTr("Vehicle ") + (vehicle ? vehicle.id : qsTr("None"))
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
color: qgcPal.buttonText color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
} }
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
text: vehicle ? vehicle.flightMode : qsTr("None") text: vehicle ? vehicle.flightMode : qsTr("None")
color: qgcPal.buttonText color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
} }
Rectangle { Rectangle {
height: ScreenTools.defaultFontPixelHeight * 0.5 height: ScreenTools.defaultFontPixelHeight * 0.5
......
...@@ -491,7 +491,7 @@ Item { ...@@ -491,7 +491,7 @@ Item {
id: multiVehicleSelector id: multiVehicleSelector
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: ScreenTools.defaultFontPixelWidth anchors.bottomMargin: ScreenTools.defaultFontPixelWidth * 1.5
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.multiVehicleManager.vehicles.count > 1 visible: QGroundControl.multiVehicleManager.vehicles.count > 1
...@@ -501,6 +501,9 @@ Item { ...@@ -501,6 +501,9 @@ Item {
property var _vehicle: QGroundControl.multiVehicleManager.vehicles.get(modelData) property var _vehicle: QGroundControl.multiVehicleManager.vehicles.get(modelData)
vehicle: _vehicle vehicle: _vehicle
checked: (_vehicle && activeVehicle) ? _vehicle.id === activeVehicle.id : false checked: (_vehicle && activeVehicle) ? _vehicle.id === activeVehicle.id : false
onClicked: {
QGroundControl.multiVehicleManager.activeVehicle = _vehicle
}
} }
} }
} }
......
...@@ -281,7 +281,7 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t& ...@@ -281,7 +281,7 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t&
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#9d9d9d"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#9d9d9d");
} }
else if (colorName == QStringLiteral("buttonHighlight")) { else if (colorName == QStringLiteral("buttonHighlight")) {
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#6EF880"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#F3BC5E");
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#222a35"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#222a35");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#edcfb4"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#edcfb4");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#e4e4e4"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#e4e4e4");
...@@ -299,9 +299,9 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t& ...@@ -299,9 +299,9 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t&
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#585858"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#585858");
} }
else if (colorName == QStringLiteral("primaryButtonText")) { else if (colorName == QStringLiteral("primaryButtonText")) {
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#ffffff"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#29313A");
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#777c89"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#777c89");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#ffffff"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#29313A");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#cad0d0"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#cad0d0");
} }
else if (colorName == QStringLiteral("textField")) { else if (colorName == QStringLiteral("textField")) {
......
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