Browse Source

FlyView: Fix insets on the widget layer

makes all elements on the fly view widget layer properly pass out
tool insets
QGC4.4
James Mare 2 years ago committed by Don Gagne
parent
commit
1b37c0ec46
  1. 53
      src/FlightDisplay/FlyViewWidgetLayer.qml

53
src/FlightDisplay/FlyViewWidgetLayer.qml

@ -51,17 +51,17 @@ Item {
QGCToolInsets { QGCToolInsets {
id: _totalToolInsets id: _totalToolInsets
leftEdgeTopInset: toolStrip.leftInset leftEdgeTopInset: toolStrip.leftInset
leftEdgeCenterInset: toolStrip.leftInset leftEdgeCenterInset: parentToolInsets.leftEdgeCenterInset
leftEdgeBottomInset: parentToolInsets.leftEdgeBottomInset leftEdgeBottomInset: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.leftInset : parentToolInsets.leftEdgeBottomInset
rightEdgeTopInset: parentToolInsets.rightEdgeTopInset rightEdgeTopInset: instrumentPanel.rightInset
rightEdgeCenterInset: parentToolInsets.rightEdgeCenterInset rightEdgeCenterInset: (telemetryPanel.rightInset > photoVideoControl.rightInset) ? telemetryPanel.rightInset : photoVideoControl.rightInset
rightEdgeBottomInset: parentToolInsets.rightEdgeBottomInset rightEdgeBottomInset: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.rightInset : parentToolInsets.rightEdgeBottomInset
topEdgeLeftInset: parentToolInsets.topEdgeLeftInset topEdgeLeftInset: toolStrip.topInset
topEdgeCenterInset: parentToolInsets.topEdgeCenterInset topEdgeCenterInset: mapScale.topInset
topEdgeRightInset: parentToolInsets.topEdgeRightInset topEdgeRightInset: instrumentPanel.topInset
bottomEdgeLeftInset: parentToolInsets.bottomEdgeLeftInset bottomEdgeLeftInset: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.bottomInset : parentToolInsets.bottomEdgeLeftInset
bottomEdgeCenterInset: mapScale.centerInset bottomEdgeCenterInset: telemetryPanel.bottomInset
bottomEdgeRightInset: 0 bottomEdgeRightInset: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.bottomInset : parentToolInsets.bottomEdgeRightInset
} }
FlyViewMissionCompleteDialog { FlyViewMissionCompleteDialog {
@ -126,6 +126,7 @@ Item {
availableHeight: parent.height - y - _toolsMargin availableHeight: parent.height - y - _toolsMargin
property real rightInset: visible ? parent.width - x : 0 property real rightInset: visible ? parent.width - x : 0
property real topInset: visible ? y + height : 0
} }
PhotoVideoControl { PhotoVideoControl {
@ -133,6 +134,9 @@ Item {
anchors.margins: _toolsMargin anchors.margins: _toolsMargin
anchors.right: parent.right anchors.right: parent.right
width: _rightPanelWidth width: _rightPanelWidth
property real rightInset: visible ? parent.width - x : 0
state: _verticalCenter ? "verticalCenter" : "topAnchor" state: _verticalCenter ? "verticalCenter" : "topAnchor"
states: [ states: [
State { State {
@ -161,6 +165,9 @@ Item {
x: recalcXPosition() x: recalcXPosition()
anchors.margins: _toolsMargin anchors.margins: _toolsMargin
property real bottomInset: 0
property real rightInset: 0
// States for custom layout support // States for custom layout support
states: [ states: [
State { State {
@ -178,6 +185,8 @@ Item {
PropertyChanges { PropertyChanges {
target: telemetryPanel target: telemetryPanel
x: recalcXPosition() x: recalcXPosition()
bottomInset: visible ? parent.height-y : 0
rightInset: 0
} }
}, },
@ -192,6 +201,11 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: undefined anchors.verticalCenter: undefined
} }
PropertyChanges {
target: telemetryPanel
bottomInset: 0
rightInset: visible ? parent.width - x : 0
}
}, },
State { State {
@ -205,6 +219,11 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
PropertyChanges {
target: telemetryPanel
bottomInset: 0
rightInset: visible ? parent.width - x : 0
}
} }
] ]
@ -240,6 +259,12 @@ Item {
property bool autoCenterThrottle: QGroundControl.settingsManager.appSettings.virtualJoystickAutoCenterThrottle.rawValue property bool autoCenterThrottle: QGroundControl.settingsManager.appSettings.virtualJoystickAutoCenterThrottle.rawValue
property bool _virtualJoystickEnabled: QGroundControl.settingsManager.appSettings.virtualJoystick.rawValue property bool _virtualJoystickEnabled: QGroundControl.settingsManager.appSettings.virtualJoystick.rawValue
property real bottomInset: parent.height-y
// Width is difficult to access directly hence this hack which may not work in all circumstances
property real leftInset: visible ? bottomInset + width/18 - ScreenTools.defaultFontPixelHeight*2 : 0
property real rightInset: visible ? bottomInset + width/18 - ScreenTools.defaultFontPixelHeight*2 : 0
} }
FlyViewToolStrip { FlyViewToolStrip {
@ -254,7 +279,9 @@ Item {
onDisplayPreFlightChecklist: preFlightChecklistPopup.createObject(mainWindow).open() onDisplayPreFlightChecklist: preFlightChecklistPopup.createObject(mainWindow).open()
property real leftInset: x + width
property real topInset: visible ? y + height : 0
property real leftInset: visible ? x + width : 0
} }
GripperMenu { GripperMenu {
@ -275,7 +302,7 @@ Item {
buttonsOnLeft: false buttonsOnLeft: false
visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.flyView.showMapScale && mapControl.pipState.state === mapControl.pipState.fullState visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.flyView.showMapScale && mapControl.pipState.state === mapControl.pipState.fullState
property real centerInset: visible ? parent.height - y : 0 property real topInset: visible ? y + height : 0
} }
Component { Component {

Loading…
Cancel
Save