| 1 |
import QtQuick 2.4 |
| 2 |
import FlightGear.Launcher 1.0 |
| 3 |
import FlightGear 1.0 |
| 4 |
|
| 5 |
Row { |
| 6 |
id: root |
| 7 |
height: childrenRect.height |
| 8 |
spacing: Style.margin |
| 9 |
property bool enabled: true |
| 10 |
property alias unitsMode: edit.unitsMode |
| 11 |
|
| 12 |
ToggleSwitch { |
| 13 |
id: altitudeToggle |
| 14 |
checked: _location.altitudeEnabled |
| 15 |
|
| 16 |
function toggle(newChecked) { |
| 17 |
_location.altitudeEnabled = newChecked |
| 18 |
} |
| 19 |
|
| 20 |
enabled: parent.enabled |
| 21 |
} |
| 22 |
|
| 23 |
readonly property bool __rowEnabled: root.enabled && _location.altitudeEnabled |
| 24 |
|
| 25 |
NumericalEdit { |
| 26 |
id: edit |
| 27 |
label: qsTr("Altitude:") |
| 28 |
enabled: __rowEnabled |
| 29 |
quantity: _location.altitude |
| 30 |
onCommit: _location.altitude = newValue |
| 31 |
unitsMode: Units.AltitudeIncludingMetersAndAboveField |
| 32 |
} |
| 33 |
} |