2021-06-06 18:34:27 +02:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2021-06-08 19:23:55 +02:00
|
|
|
import QtQuick.Controls.Material 2.15
|
2021-06-06 18:34:27 +02:00
|
|
|
|
2021-06-08 19:23:55 +02:00
|
|
|
ColoredItemDelegate {
|
2021-06-06 18:34:27 +02:00
|
|
|
id: partDel
|
|
|
|
|
2021-06-08 19:23:55 +02:00
|
|
|
property int thisIndex: index
|
|
|
|
property var thisData: widgetData[ "participants" ][partDel.thisIndex]
|
2021-06-06 18:34:27 +02:00
|
|
|
|
|
|
|
width: control.width
|
2021-06-07 20:56:53 +02:00
|
|
|
height: partDelCol.showSideBySide ? 40:70
|
2021-06-06 18:34:27 +02:00
|
|
|
|
|
|
|
text: ""
|
|
|
|
|
|
|
|
opacity: 0
|
|
|
|
scale: 0.9
|
|
|
|
|
|
|
|
onThisDataChanged: {
|
|
|
|
fadeInPa.start()
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
app.openWidget({person:thisData["PerId"]})
|
|
|
|
}
|
|
|
|
|
2021-06-08 19:23:55 +02:00
|
|
|
highlighted: partDel.thisIndex % 2 == 0
|
|
|
|
|
2021-06-06 18:34:27 +02:00
|
|
|
ParallelAnimation {
|
|
|
|
id: fadeInPa
|
|
|
|
NumberAnimation { target: partDel; property: "opacity"; from: 0; to: 1.0; duration: 400 }
|
|
|
|
NumberAnimation { target: partDel; property: "scale"; from: 0.8; to: 1.0; duration: 400 }
|
|
|
|
}
|
|
|
|
|
2023-07-15 10:11:26 +02:00
|
|
|
Rectangle {
|
|
|
|
visible: widgetData["route_quota"] !== null && parseInt(widgetData["route_quota"]) - 1 === thisIndex
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
verticalCenter: parent.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
height: 3
|
|
|
|
color: Material.primaryTextColor
|
|
|
|
}
|
|
|
|
|
2021-06-06 18:34:27 +02:00
|
|
|
GridLayout {
|
|
|
|
id: partDelCol
|
|
|
|
|
2021-06-07 20:56:53 +02:00
|
|
|
property bool showSideBySide: app.landscape() || app.largeScreen()
|
|
|
|
|
2021-06-06 18:34:27 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 5
|
|
|
|
|
2021-06-07 20:56:53 +02:00
|
|
|
columns: showSideBySide ? 2:1
|
|
|
|
rows: showSideBySide ? 1:2
|
2021-06-06 18:34:27 +02:00
|
|
|
|
|
|
|
columnSpacing: height * 0.2
|
|
|
|
rowSpacing: 0
|
|
|
|
|
|
|
|
Row {
|
|
|
|
id: partDelFirstRow
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
Label {
|
|
|
|
height: parent.height
|
|
|
|
width: text === "" ? parent.width * 0.08:parent.width * 0.1
|
|
|
|
|
|
|
|
fontSizeMode: Text.Fit
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: Math.abs( partDelSecondRow.height > 0 ? height * 0.6:height * 0.4 )
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
|
|
|
text: partDel.thisData["result_rank"] === undefined ? "":partDel.thisData["result_rank"]
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width * 0.5
|
|
|
|
|
|
|
|
fontSizeMode: Text.Fit
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: Math.abs( partDelSecondRow.height > 0 ? height * 0.6:height * 0.4 )
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
|
|
|
|
text: partDel.thisData["firstname"] + " " + partDel.thisData["lastname"] + (partDel.thisData["start_number"] !== undefined ? (" (" + partDel.thisData["start_number"] + ")"):"")
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width * 0.4
|
|
|
|
|
|
|
|
fontSizeMode: Text.Fit
|
|
|
|
font.bold: false
|
|
|
|
font.pixelSize: Math.abs( partDelSecondRow.height > 0 ? height * 0.4:height * 0.3 )
|
|
|
|
minimumPixelSize: height * 0.3 < 1 ? 1:height * 0.3
|
|
|
|
|
|
|
|
elide: "ElideRight"
|
|
|
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
|
|
|
text: "<html>(<a href=\"" + (partDel.thisData["fed_url"] === undefined ? "":partDel.thisData["fed_url"]).toString() + "\">" + (widgetData[ "display_athlete" ] === "nation" ? partDel.thisData["nation"] : partDel.thisData["federation"]) + "</a>)</html>"
|
|
|
|
|
|
|
|
onLinkActivated: {
|
|
|
|
Qt.openUrlExternally(link)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Row {
|
|
|
|
id: partDelSecondRow
|
|
|
|
|
2021-06-07 20:56:53 +02:00
|
|
|
Layout.preferredWidth: partDelCol.showSideBySide ? parent.width * 0.5 : parent.width
|
|
|
|
Layout.preferredHeight: partDelCol.showSideBySide ? parent.height : parent.height * 0.5
|
2021-06-06 18:34:27 +02:00
|
|
|
|
2023-07-05 16:27:15 +02:00
|
|
|
visible: boulderResRow.active || generalResRow.active || speedQualificationResRow.active || resultLa.active
|
2021-06-06 18:34:27 +02:00
|
|
|
|
2023-07-05 16:27:15 +02:00
|
|
|
BoulderResultRow {
|
|
|
|
id: boulderResRow
|
2021-06-06 18:34:27 +02:00
|
|
|
}
|
|
|
|
|
2023-07-05 16:27:15 +02:00
|
|
|
GeneralResultRow {
|
|
|
|
id: generalResRow
|
|
|
|
}
|
2021-06-06 18:34:27 +02:00
|
|
|
|
2023-07-05 16:27:15 +02:00
|
|
|
SpeedQualificationResultRow {
|
|
|
|
id: speedQualificationResRow
|
2021-06-06 18:34:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: resultLa
|
|
|
|
|
2023-07-05 16:27:15 +02:00
|
|
|
property bool active: ( parseInt(widgetData[ "route_num_problems" ]) > 0 || widgetData["discipline"] !== "boulder" ) && parseInt(widgetData[ "route_order" ]) > -1 && !speedQualificationResRow.active
|
2021-06-06 18:34:27 +02:00
|
|
|
|
|
|
|
width: enabled ? parent.width * 0.25:0
|
|
|
|
height: enabled ? parent.height:0
|
|
|
|
|
2023-07-05 16:27:15 +02:00
|
|
|
enabled: active
|
2021-06-06 18:34:27 +02:00
|
|
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
|
|
|
fontSizeMode: Text.Fit
|
|
|
|
font.pixelSize: Math.abs( height * 0.6 )
|
|
|
|
minimumPixelSize: 1
|
|
|
|
|
2021-06-08 19:23:55 +02:00
|
|
|
text: widgetData[ "participants" ][partDel.thisIndex]["result"] === undefined ? "":widgetData[ "participants" ][partDel.thisIndex]["result"]
|
2021-06-06 18:34:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|