Browse Source

Use alternate instruments for small screen

QGC4.4
Don Gagne 9 years ago
parent
commit
20458c5b0c
  1. 2
      src/FlightDisplay/FlightDisplayView.qml
  2. 30
      src/FlightDisplay/FlightDisplayViewWidgets.qml

2
src/FlightDisplay/FlightDisplayView.qml

@ -223,7 +223,7 @@ QGCView {
//-- Virtual Joystick //-- Virtual Joystick
Loader { Loader {
id: multiTouchItem id: virtualJoystickMultiTouch
z: _panel.z + 5 z: _panel.z + 5
width: parent.width - (_flightVideoPipControl.width / 2) width: parent.width - (_flightVideoPipControl.width / 2)
height: Math.min(ScreenTools.availableHeight * 0.25, ScreenTools.defaultFontPixelWidth * 16) height: Math.min(ScreenTools.availableHeight * 0.25, ScreenTools.defaultFontPixelWidth * 16)

30
src/FlightDisplay/FlightDisplayViewWidgets.qml

@ -27,9 +27,11 @@ 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 property bool _lightWidgetBorders: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
property bool _useAlternateInstruments: QGroundControl.virtualTabletJoystick || ScreenTools.isTinyScreen
readonly property real _margins: ScreenTools.defaultFontPixelHeight / 2 readonly property real _margins: ScreenTools.defaultFontPixelHeight / 2
@ -94,7 +96,7 @@ Item {
anchors.margins: ScreenTools.defaultFontPixelHeight / 2 anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: !QGroundControl.virtualTabletJoystick visible: !_useAlternateInstruments
size: getGadgetWidth() size: getGadgetWidth()
active: _activeVehicle != null active: _activeVehicle != null
heading: _heading heading: _heading
@ -113,8 +115,8 @@ Item {
anchors.margins: ScreenTools.defaultFontPixelHeight / 2 anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.top: parent.top anchors.top: parent.top
anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right
visible: QGroundControl.virtualTabletJoystick visible: _useAlternateInstruments
width: ScreenTools.isTinyScreen ? getGadgetWidth() * 2 : getGadgetWidth() width: ScreenTools.isTinyScreen ? getGadgetWidth() * 1.5 : getGadgetWidth()
active: _activeVehicle != null active: _activeVehicle != null
heading: _heading heading: _heading
rollAngle: _roll rollAngle: _roll
@ -126,14 +128,14 @@ Item {
} }
ValuesWidget { ValuesWidget {
anchors.topMargin: ScreenTools.defaultFontPixelHeight anchors.topMargin: ScreenTools.defaultFontPixelHeight
anchors.top: instrumentGadgetAlternate.bottom anchors.top: instrumentGadgetAlternate.bottom
anchors.left: instrumentGadgetAlternate.left anchors.horizontalCenter: instrumentGadgetAlternate.horizontalCenter
width: getGadgetWidth() width: getGadgetWidth()
qgcView: parent.parent.qgcView qgcView: parent.parent.qgcView
textColor: _isSatellite ? "white" : "black" textColor: _isSatellite ? "white" : "black"
visible: QGroundControl.virtualTabletJoystick visible: _useAlternateInstruments
maxHeight: multiTouchItem.y - y maxHeight: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.y - y : parent.height - anchors.margins - y
} }
//-- Vertical Tool Buttons //-- Vertical Tool Buttons

Loading…
Cancel
Save