2017-10-13 15:48:24 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
import FlightGear.Launcher 1.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
signal select(var uri);
|
|
|
|
signal showDetails(var uri)
|
|
|
|
|
2017-12-05 20:53:47 +00:00
|
|
|
implicitHeight: Math.max(contentBox.childrenRect.height, thumbnailBox.height) +
|
|
|
|
footer.height
|
2017-10-13 15:48:24 +00:00
|
|
|
implicitWidth: ListView.view.width
|
|
|
|
|
|
|
|
readonly property bool __isSelected: ListView.isCurrentItem
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
if (__isSelected) {
|
|
|
|
root.showDetails(model.uri)
|
|
|
|
} else {
|
|
|
|
root.select(model.uri)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: thumbnailBox
|
|
|
|
// thumbnail border
|
|
|
|
|
|
|
|
y: Math.max(0, Math.round((contentBox.childrenRect.height - height) * 0.5))
|
|
|
|
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#7f7f7f"
|
|
|
|
|
|
|
|
width: thumbnail.width
|
|
|
|
height: thumbnail.height
|
|
|
|
|
|
|
|
ThumbnailImage {
|
|
|
|
id: thumbnail
|
|
|
|
|
|
|
|
aircraftUri: model.uri
|
|
|
|
maximumSize.width: 172
|
|
|
|
maximumSize.height: 128
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: contentBox
|
|
|
|
|
|
|
|
anchors {
|
2017-12-05 20:53:47 +00:00
|
|
|
margins: Style.margin
|
2017-10-13 15:48:24 +00:00
|
|
|
left: thumbnailBox.right
|
|
|
|
right: parent.right
|
|
|
|
top: parent.top
|
|
|
|
}
|
|
|
|
|
2017-12-05 20:53:47 +00:00
|
|
|
spacing: Style.margin
|
2017-10-13 15:48:24 +00:00
|
|
|
|
|
|
|
AircraftVariantChoice {
|
|
|
|
id: titleBox
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
aircraft: model.uri;
|
|
|
|
currentIndex: model.activeVariant
|
|
|
|
onSelected: {
|
|
|
|
model.activeVariant = index
|
|
|
|
root.select(model.uri)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: description
|
|
|
|
width: parent.width
|
|
|
|
text: model.description
|
|
|
|
maximumLineCount: 3
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
elide: Text.ElideRight
|
|
|
|
height: implicitHeight
|
|
|
|
visible: model.description != ""
|
|
|
|
}
|
|
|
|
|
|
|
|
AircraftDownloadPanel
|
|
|
|
{
|
|
|
|
id: downloadPanel
|
|
|
|
visible: (model.package != undefined)
|
|
|
|
packageSize: model.packageSizeBytes
|
|
|
|
installStatus: model.packageStatus
|
|
|
|
downloadedBytes: model.downloadedBytes
|
|
|
|
uri: model.uri
|
|
|
|
width: parent.width
|
|
|
|
compact: true
|
|
|
|
}
|
|
|
|
|
|
|
|
} // of content column
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: footer
|
2017-12-05 20:53:47 +00:00
|
|
|
height: Style.margin
|
2017-10-13 15:48:24 +00:00
|
|
|
width: parent.width
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
|
|
|
Rectangle {
|
2017-12-05 20:53:47 +00:00
|
|
|
color: Style.frameColor
|
2017-10-13 15:48:24 +00:00
|
|
|
height: 1
|
2017-12-05 20:53:47 +00:00
|
|
|
width: parent.width - Style.strutSize
|
2017-10-13 15:48:24 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // of root item
|