Skip to content

Commit

Permalink
Survives starting before x-plane now
Browse files Browse the repository at this point in the history
  • Loading branch information
vranki committed Nov 25, 2019
1 parent e00609e commit a36ed8e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions qmlui/panelitems/needle/Altimeter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,23 @@ PanelItems.PanelItem {
Text {
text: altitudeConverter.outUnitName + " x " + valueBars.valueMultiplier
color: "white"
font.pixelSize: parent.height * 0.03
font.pixelSize: parent.height * 0.04
font.family: b612.name
y: parent.height * 0.70
anchors.horizontalCenter: parent.horizontalCenter
}
Text {
text: parseFloat(altimeterSettingRef.value).toPrecision(6) + " " + pressureConverter.outUnitName
color: "white"
font.pixelSize: parent.height * 0.03
font.pixelSize: parent.height * 0.04
font.family: b612.name
x: parent.width * 0.60
anchors.verticalCenter: parent.verticalCenter
Rectangle {
color: "#292929"
anchors.fill: parent
z: -1
}
}
Needle {
needleType: 2
Expand Down
5 changes: 4 additions & 1 deletion qmlui/panelitems/needle/CircularGauge.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ PanelItems.PanelItem {
property int needleType: 0
readonly property real barAngle: valueBars.barAngle

width: Math.min(parent.width, parent.height)
// Keep rectangular
readonly property int itemSize: Math.min(parent.width, parent.height)
width: itemSize
height: itemSize

CircularGaugeBars {
id: valueBars
Expand Down
2 changes: 1 addition & 1 deletion qmlui/panelitems/needle/GMeter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PanelItems.PanelItem {

CircularGauge {
id: gauge
anchors.fill: parent

gaugeValue: parseFloat(gRef.value) || 1
barValue: 1
thinBarValue: 0.5
Expand Down
5 changes: 3 additions & 2 deletions qmlui/panelitems/needle/GaugeArc.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ Shape {
property real startAngle: 0 // Angle, relative from top
property real endAngle: 90 // End
property real arcAngle: endAngle - startAngle
property real radius: centerX - arcWidth / 2
property real radius: itemSize/2 - arcWidth / 2
property real arcWidth: 5
property color arcColor: "white"
readonly property real centerX: width/2
readonly property real centerX: itemSize/2
readonly property real centerY: centerX
readonly property real itemSize: Math.min(width, height)
antialiasing: true
rotation: startAngle

Expand Down

0 comments on commit a36ed8e

Please sign in to comment.