Browse Source

FlyViewWidgetLayer: Change layout based on layout option/state

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
QGC4.4
Patrick José Pereira 4 years ago committed by Don Gagne
parent
commit
68f16f5d79
  1. 50
      src/FlightDisplay/FlyViewWidgetLayer.qml

50
src/FlightDisplay/FlyViewWidgetLayer.qml

@ -151,7 +151,53 @@ Item { @@ -151,7 +151,53 @@ Item {
id: telemetryPanel
x: recalcXPosition()
anchors.margins: _toolsMargin
anchors.bottom: parent.bottom
// States for custom layout support
states: [
State {
name: "bottom"
when: telemetryPanel.bottomMode
AnchorChanges {
target: telemetryPanel
anchors.top: undefined
anchors.bottom: parent.bottom
anchors.right: undefined
anchors.verticalCenter: undefined
}
PropertyChanges {
target: telemetryPanel
x: recalcXPosition()
}
},
State {
name: "right-video"
when: !telemetryPanel.bottomMode && photoVideoControl.visible
AnchorChanges {
target: telemetryPanel
anchors.top: photoVideoControl.bottom
anchors.bottom: undefined
anchors.right: parent.right
anchors.verticalCenter: undefined
}
},
State {
name: "right-novideo"
when: !telemetryPanel.bottomMode && !photoVideoControl.visible
AnchorChanges {
target: telemetryPanel
anchors.top: undefined
anchors.bottom: undefined
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
]
function recalcXPosition() {
// First try centered
@ -167,8 +213,6 @@ Item { @@ -167,8 +213,6 @@ Item {
return parentToolInsets.leftEdgeBottomInset + _toolsMargin
}
}
property real bottomInset: height
}
//-- Virtual Joystick

Loading…
Cancel
Save