From d0df3af583d5b5290498a288b6fc3194bee6b357 Mon Sep 17 00:00:00 2001 From: Orangerot Date: Fri, 16 Aug 2024 23:40:38 +0200 Subject: fix(EventInfoPage): show comptitor statistics --- res/gui/EventInfoPage.qml | 30 ++++++++++++++++++++---------- res/gui/EventsPage.qml | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) (limited to 'res') diff --git a/res/gui/EventInfoPage.qml b/res/gui/EventInfoPage.qml index 6c46a7f..2934931 100644 --- a/res/gui/EventInfoPage.qml +++ b/res/gui/EventInfoPage.qml @@ -4,8 +4,8 @@ import QtQuick.Controls Page { id: root - property string eventName - property list competitors + required property string eventName + required property list competitors header: ToolBar { ToolButton { @@ -31,17 +31,27 @@ Page { bottomMargin: 48 rightMargin: 48 spacing: 20 - model: eventName + model: competitors delegate: ItemDelegate { - text: "sadly not working..." + required property string name + required property string noc + required property string mark + required property string statistic + required property string gold + required property string silver + required property string bronze width: listView.width - listView.leftMargin - listView.rightMargin - height: avatar.implicitHeight + 32 - leftPadding: avatar.implicitWidth + 32 - - Image { - id: avatar - // source: "images/" + modelData.replace(" ", "_") + ".png" + height: 32 + Text { + anchors.left: parent.left + text: name + " (" + noc + ")" + } + Text { + anchors.right: parent.right + horizontalAlignment: Text.AlignRight + text: mark + " " + statistic + " | " + gold + "🥇 " + silver + "🥈 " + bronze + "🥉" } + } } diff --git a/res/gui/EventsPage.qml b/res/gui/EventsPage.qml index d21b5bb..c3d05f3 100644 --- a/res/gui/EventsPage.qml +++ b/res/gui/EventsPage.qml @@ -254,7 +254,7 @@ Page { model: filter delegate: ItemDelegate { required property string eventName - property list competitors + required property list competitors text: eventName width: listView.width - listView.leftMargin - listView.rightMargin height: avatar.height -- cgit v1.2.3