| 1 |
import QtQuick 2.4 |
| 2 |
import FlightGear 1.0 |
| 3 |
import FlightGear.Launcher 1.0 |
| 4 |
|
| 5 |
Item { |
| 6 |
id: root |
| 7 |
|
| 8 |
property alias legIndex: diagram.activeLegIndex |
| 9 |
|
| 10 |
RouteDiagram { |
| 11 |
id: diagram |
| 12 |
anchors.fill: parent |
| 13 |
flightplan: _launcher.flightPlan |
| 14 |
} |
| 15 |
|
| 16 |
Button { |
| 17 |
id: previousButton |
| 18 |
text: qsTr("Previous Leg") |
| 19 |
enabled: diagram.activeLegIndex > 0 |
| 20 |
onClicked: { |
| 21 |
diagram.activeLegIndex = diagram.activeLegIndex - 1 |
| 22 |
} |
| 23 |
|
| 24 |
anchors.right: root.horizontalCenter |
| 25 |
anchors.bottom: root.bottom |
| 26 |
anchors.margins: Style.margin |
| 27 |
} |
| 28 |
|
| 29 |
Button { |
| 30 |
text: qsTr("Next Leg") |
| 31 |
width: previousButton.width |
| 32 |
|
| 33 |
enabled: diagram.activeLegIndex < (diagram.numLegs - 1) |
| 34 |
onClicked: { |
| 35 |
diagram.activeLegIndex = diagram.activeLegIndex + 1 |
| 36 |
} |
| 37 |
|
| 38 |
anchors.left: root.horizontalCenter |
| 39 |
anchors.bottom: root.bottom |
| 40 |
anchors.margins: Style.margin |
| 41 |
} |
| 42 |
} |