Commit 3e4843f6 authored by Pierre TILAK's avatar Pierre TILAK

Restore old Instrument Widget Layout

The instrument widget layout is now a stack of :
- QGCAttitudeWidget
- Item that contain ValuesWidget
- QGCCompassWidget
parent 8a6ebbec
...@@ -20,13 +20,13 @@ import QGroundControl.Palette 1.0 ...@@ -20,13 +20,13 @@ import QGroundControl.Palette 1.0
Rectangle { Rectangle {
id: root id: root
width: getPreferredInstrumentWidth() width: getPreferredInstrumentWidth()
height: _outerRadius * 2 height: _outerRadius * 4 + _valuesWidget.height
radius: _outerRadius radius: _outerRadius
color: qgcPal.window color: qgcPal.window
border.width: 1 border.width: 1
border.color: _isSatellite ? qgcPal.mapWidgetBorderLight : qgcPal.mapWidgetBorderDark border.color: _isSatellite ? qgcPal.mapWidgetBorderLight : qgcPal.mapWidgetBorderDark
property real _innerRadius: (width - (_topBottomMargin * 3)) / 4 property real _innerRadius: (width - (_topBottomMargin * 2)) / 2
property real _outerRadius: _innerRadius + _topBottomMargin property real _outerRadius: _innerRadius + _topBottomMargin
property real _defaultSize: ScreenTools.defaultFontPixelHeight * (9) property real _defaultSize: ScreenTools.defaultFontPixelHeight * (9)
property real _sizeRatio: ScreenTools.isTinyScreen ? (width / _defaultSize) * 0.5 : width / _defaultSize property real _sizeRatio: ScreenTools.isTinyScreen ? (width / _defaultSize) * 0.5 : width / _defaultSize
...@@ -45,27 +45,21 @@ Rectangle { ...@@ -45,27 +45,21 @@ Rectangle {
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
QGCAttitudeWidget { QGCAttitudeWidget {
id: attitude id: attitude
anchors.leftMargin: _topBottomMargin anchors.topMargin : _topBottomMargin
anchors.left: parent.left anchors.bottomMargin: _topBottomMargin
size: _innerRadius * 2 anchors.top: parent.top
vehicle: activeVehicle size: _innerRadius * 2
anchors.verticalCenter: parent.verticalCenter vehicle: activeVehicle
anchors.horizontalCenter: parent.horizontalCenter
} }
QGCCompassWidget {
id: compass
anchors.leftMargin: _spacing
anchors.left: attitude.right
size: _innerRadius * 2
vehicle: activeVehicle
anchors.verticalCenter: parent.verticalCenter
}
Item { Item {
id: _valuesItem id: _valuesItem
anchors.topMargin: ScreenTools.defaultFontPixelHeight / 4 anchors.topMargin: ScreenTools.defaultFontPixelHeight / 4
anchors.top: parent.bottom anchors.top: attitude.bottom
anchors.bottom: compass.top
width: parent.width width: parent.width
height: _valuesWidget.height height: _valuesWidget.height
visible: widgetRoot.showValues visible: widgetRoot.showValues
...@@ -88,4 +82,14 @@ Rectangle { ...@@ -88,4 +82,14 @@ Rectangle {
maxHeight: _availableValueHeight maxHeight: _availableValueHeight
} }
} }
QGCCompassWidget {
id: compass
anchors.bottom : parent.bottom
anchors.bottomMargin: _topBottomMargin
anchors.topMargin: _topBottomMargin
size: _innerRadius * 2
vehicle: activeVehicle
anchors.horizontalCenter: parent.horizontalCenter
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment