Skip to content

Commit

Permalink
Rework sizing to take less horizontal space
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Feb 9, 2024
1 parent a32c9ab commit 01ccf02
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
1 change: 0 additions & 1 deletion src/FlightDisplay/FlyView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ Item {
anchors.bottom: parent.bottom
z: QGroundControl.zOrderTopMost
radius: ScreenTools.defaultFontPixelWidth / 2
width: ScreenTools.defaultFontPixelWidth * 10
color: qgcPal.window
visible: false
}
Expand Down
61 changes: 30 additions & 31 deletions src/FlightDisplay/GuidedValueSlider.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import QGroundControl
import QGroundControl.Controls
import QGroundControl.Vehicle
import QGroundControl.Palette

Rectangle {
id: _root
width: mainLayout.x + mainLayout.width + mainLayout.anchors.margins

property var _flyViewSettings: QGroundControl.settingsManager.flyViewSettings
property real _vehicleAltitude: _activeVehicle ? _activeVehicle.altitudeRelative.rawValue : 0
Expand Down Expand Up @@ -88,26 +89,27 @@ Rectangle {
}
}

Column {
id: headerColumn
ColumnLayout {
id: mainLayout
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: 0

QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
Layout.preferredWidth: 1
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
text: _displayText
horizontalAlignment: Text.AlignHCenter
}

QGCLabel {
id: valueField
anchors.horizontalCenter: parent.horizontalCenter
text: newValueAppUnits + " " + (_speedSlider ? QGroundControl.unitsConversion.appSettingsSpeedUnitsString
: QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString)
id: valueField
Layout.alignment: Qt.AlignHCenter
text: newValueAppUnits + " " +
(_speedSlider ? QGroundControl.unitsConversion.appSettingsSpeedUnitsString : QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString)

property real newValue
property string newValueAppUnits
Expand Down Expand Up @@ -154,26 +156,23 @@ Rectangle {
}
}
}
}

QGCSlider {
id: valueSlider
anchors.margins: _margins
anchors.top: headerColumn.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
orientation: Qt.Vertical
from: -1
to: 1
zeroCentered: false
rotation: 180

// We want slide up to be positive values
transform: Rotation {
origin.x: valueSlider.width / 2
origin.y: valueSlider.height / 2
angle: 180
QGCSlider {
id: valueSlider
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
orientation: Qt.Vertical
from: -1
to: 1
zeroCentered: false
rotation: 180

// We want slide up to be positive values
transform: Rotation {
origin.x: valueSlider.width / 2
origin.y: valueSlider.height / 2
angle: 180
}
}
}
}

0 comments on commit 01ccf02

Please sign in to comment.