5 changed files with 91 additions and 4 deletions
@ -0,0 +1,86 @@
@@ -0,0 +1,86 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (c) 2009-2022 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> |
||||
* |
||||
* QGroundControl is licensed according to the terms in the file |
||||
* COPYING.md in the root of the source code directory. |
||||
* |
||||
****************************************************************************/ |
||||
|
||||
import QtQuick 2.11 |
||||
import QtQuick.Layouts 1.11 |
||||
|
||||
import QGroundControl 1.0 |
||||
import QGroundControl.Controls 1.0 |
||||
import QGroundControl.MultiVehicleManager 1.0 |
||||
import QGroundControl.ScreenTools 1.0 |
||||
import QGroundControl.Palette 1.0 |
||||
|
||||
RowLayout { |
||||
id: _root |
||||
spacing: 0 |
||||
|
||||
property real fontPointSize: ScreenTools.largeFontPointSize |
||||
property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle |
||||
|
||||
Component { |
||||
id: flightModeMenu |
||||
|
||||
Rectangle { |
||||
width: flickable.width + (ScreenTools.defaultFontPixelWidth * 2) |
||||
height: flickable.height + (ScreenTools.defaultFontPixelWidth * 2) |
||||
radius: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
color: qgcPal.window |
||||
border.color: qgcPal.text |
||||
|
||||
QGCFlickable { |
||||
id: flickable |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
anchors.top: parent.top |
||||
anchors.left: parent.left |
||||
width: mainLayout.width |
||||
height: _fullWindowHeight <= mainLayout.height ? _fullWindowHeight : mainLayout.height |
||||
flickableDirection: Flickable.VerticalFlick |
||||
contentHeight: mainLayout.height |
||||
contentWidth: mainLayout.width |
||||
|
||||
property real _fullWindowHeight: mainWindow.contentItem.height - (indicatorPopup.padding * 2) - (ScreenTools.defaultFontPixelWidth * 2) |
||||
|
||||
ColumnLayout { |
||||
id: mainLayout |
||||
spacing: ScreenTools.defaultFontPixelWidth / 2 |
||||
|
||||
Repeater { |
||||
model: activeVehicle ? activeVehicle.flightModes : [] |
||||
|
||||
QGCButton { |
||||
text: modelData |
||||
Layout.fillWidth: true |
||||
onClicked: { |
||||
activeVehicle.flightMode = text |
||||
mainWindow.hideIndicatorPopup() |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
RowLayout { |
||||
Layout.fillWidth: true |
||||
|
||||
QGCLabel { |
||||
text: activeVehicle ? activeVehicle.flightMode : qsTr("N/A", "No data to display") |
||||
font.pointSize: fontPointSize |
||||
Layout.alignment: Qt.AlignCenter |
||||
|
||||
MouseArea { |
||||
anchors.fill: parent |
||||
onClicked: { |
||||
mainWindow.showIndicatorPopup(_root, flightModeMenu) |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue