Browse Source

Fix display of vertical instrument panel

QGC4.4
DonLakeFlyer 4 years ago committed by Don Gagne
parent
commit
7d25fb1ed0
  1. 23
      src/FlightDisplay/FlyViewWidgetLayer.qml
  2. 2
      src/FlightMap/Widgets/PhotoVideoControl.qml
  3. 22
      src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml

23
src/FlightDisplay/FlyViewWidgetLayer.qml

@ -120,10 +120,31 @@ Item {
} }
PhotoVideoControl { PhotoVideoControl {
id: photoVideoControl
anchors.margins: _toolsMargin anchors.margins: _toolsMargin
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
width: _rightPanelWidth width: _rightPanelWidth
state: _verticalCenter ? "verticalCenter" : "topAnchor"
states: [
State {
name: "verticalCenter"
AnchorChanges {
target: photoVideoControl
anchors.top: undefined
anchors.verticalCenter: _root.verticalCenter
}
},
State {
name: "topAnchor"
AnchorChanges {
target: photoVideoControl
anchors.verticalCenter: undefined
anchors.top: instrumentPanel.bottom
}
}
]
property bool _verticalCenter: !QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel.rawValue
} }
TelemetryValuesBar { TelemetryValuesBar {

2
src/FlightMap/Widgets/PhotoVideoControl.qml

@ -27,7 +27,7 @@ Rectangle {
height: mainLayout.height + (_margins * 2) height: mainLayout.height + (_margins * 2)
color: "#80000000" color: "#80000000"
radius: _margins radius: _margins
visible: !QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel.rawValue && (_mavlinkCamera || _videoStreamAvailable || _simpleCameraAvailable) && multiVehiclePanelSelector.showSingleVehiclePanel visible: (_mavlinkCamera || _videoStreamAvailable || _simpleCameraAvailable) && multiVehiclePanelSelector.showSingleVehiclePanel
property real _margins: ScreenTools.defaultFontPixelHeight / 2 property real _margins: ScreenTools.defaultFontPixelHeight / 2
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle

22
src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml

@ -7,7 +7,6 @@
* *
****************************************************************************/ ****************************************************************************/
import QtQuick 2.3 import QtQuick 2.3
import QGroundControl 1.0 import QGroundControl 1.0
@ -18,30 +17,23 @@ import QGroundControl.FlightMap 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
Rectangle { Rectangle {
id: root height: _outerRadius * 4
height: _outerRadius * 4 + _valuesWidget.height
radius: _outerRadius radius: _outerRadius
color: qgcPal.window color: QGroundControl.globalPalette.window
// These properties are expected to be in the Loader
// property real maxHeight
// property bool showValues - true: show value pages
property real _innerRadius: (width - (_topBottomMargin * 2)) / 2 property real _outerMargin: (width * 0.05) / 2
property real _outerRadius: _innerRadius + _topBottomMargin * 2 property real _outerRadius: width / 2
property real _margins: (width * 0.05) / 2 property real _innerRadius: _outerRadius - _outerMargin
// Prevent all clicks from going through to lower layers // Prevent all clicks from going through to lower layers
DeadMouseArea { DeadMouseArea {
anchors.fill: parent anchors.fill: parent
} }
QGCPalette { id: qgcPal }
QGCAttitudeWidget { QGCAttitudeWidget {
id: attitude id: attitude
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.margins : _margins anchors.topMargin: _outerMargin
anchors.top: parent.top anchors.top: parent.top
size: _innerRadius * 2 size: _innerRadius * 2
vehicle: globals.activeVehicle vehicle: globals.activeVehicle
@ -50,7 +42,7 @@ Rectangle {
QGCCompassWidget { QGCCompassWidget {
id: compass id: compass
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.margins: _margins anchors.topMargin: _outerMargin * 2
anchors.top: attitude.bottom anchors.top: attitude.bottom
size: _innerRadius * 2 size: _innerRadius * 2
vehicle: globals.activeVehicle vehicle: globals.activeVehicle

Loading…
Cancel
Save