From acd436f00091ff0c8871bd5aa31fb10ddc2d3b3a Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Thu, 8 Jul 2021 12:23:55 +0200 Subject: [PATCH] - show route name instead of category name in subtitle - reset scroll of synceed label when scroll of moving label is being reset --- CHANGELOG.md | 1 + resources/qml/Components/MovingLabel.qml | 2 ++ resources/qml/Widgets/RegistrationWidget.qml | 7 ++----- resources/qml/Widgets/ResultWidget.qml | 16 +++------------- resources/qml/Widgets/StartlistWidget.qml | 18 +++++++----------- resources/qml/main.qml | 2 +- 6 files changed, 16 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41b286a..ba6abac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. # [0.06] - UNRELEASED ### Changed +- The subtitle in results and startlists is now the route name instead of the category name ### Added - Dark mode diff --git a/resources/qml/Components/MovingLabel.qml b/resources/qml/Components/MovingLabel.qml index c7f1ca8..67b1ad8 100644 --- a/resources/qml/Components/MovingLabel.qml +++ b/resources/qml/Components/MovingLabel.qml @@ -21,6 +21,8 @@ Item { onTextChanged: { _resetScroll() + if(control.syncWithLabel) + control.syncWithLabel._resetScroll() } function startScroll(triggerSyncedLabel=true) { diff --git a/resources/qml/Widgets/RegistrationWidget.qml b/resources/qml/Widgets/RegistrationWidget.qml index c97a2dc..dd4cc75 100644 --- a/resources/qml/Widgets/RegistrationWidget.qml +++ b/resources/qml/Widgets/RegistrationWidget.qml @@ -76,13 +76,10 @@ DataListView { //% "(Registration)" var addition = qsTrId("#registrationHeadline") - if(titleString !== undefined){ + if(titleString) return addition + " " + titleString - } - else { + else return "" - } - } function getText(athleteData){ diff --git a/resources/qml/Widgets/ResultWidget.qml b/resources/qml/Widgets/ResultWidget.qml index 7246e3c..1ac9ef1 100644 --- a/resources/qml/Widgets/ResultWidget.qml +++ b/resources/qml/Widgets/ResultWidget.qml @@ -124,25 +124,15 @@ DataListView { } function getSubtitle() { - var titleString + var titleString = control.widgetData["route_name"] - for(var i = 0; i < control.widgetData["categorys"].length; i ++ ){ - //console.log("checking " + i + ": cat: " + parseInt(control.widgetData["categorys"][i]["GrpId"]) + " searched cat: " + params.cat) - if(parseInt(control.widgetData["categorys"][i]["GrpId"]) === parseInt(params.cat)){ - titleString = control.widgetData["categorys"][i]["name"] - } - } //% "(Results)" var addition = qsTrId("#resultsHeadline") - if(titleString !== undefined){ + if(titleString) return addition + " " + titleString - } - else { + else return "" - } - - } function changeRoute(route) { diff --git a/resources/qml/Widgets/StartlistWidget.qml b/resources/qml/Widgets/StartlistWidget.qml index 44cce04..4de9d02 100644 --- a/resources/qml/Widgets/StartlistWidget.qml +++ b/resources/qml/Widgets/StartlistWidget.qml @@ -59,19 +59,15 @@ DataListView { } function getSubtitle() { - var titleString + var titleString = control.widgetData["route_name"] - for(var i = 0; i < control.widgetData["categorys"].length; i ++ ){ - //console.log("checking " + i + ": cat: " + parseInt(control.widgetData["categorys"][i]["GrpId"]) + " searched cat: " + params.cat) - if(parseInt(control.widgetData["categorys"][i]["GrpId"]) === parseInt(params.cat)){ - titleString = control.widgetData["categorys"][i]["name"] - } - } - - //% "(Startlist)"https://l.bluerock.dev/?comp=11601&type=starters + //% "(Startlist)" var addition = qsTrId("#startlistHeadline") - return addition + " " + titleString + if(titleString) + return addition + " " + titleString + else + return "" } function changeRoute(route) { @@ -134,7 +130,7 @@ DataListView { property int thisIndex: index property var thisData: widgetData[ "participants" ][index] - width: parent.width + width: control.width height: 50 opacity: 0 diff --git a/resources/qml/main.qml b/resources/qml/main.qml index e73273a..72c8c6c 100644 --- a/resources/qml/main.qml +++ b/resources/qml/main.qml @@ -198,7 +198,7 @@ Window { //openWidget({comp: 11651, cat: 26}) //openWidget({person: 6623}) //console.log(JSON.stringify(serverConn.getParamsFromUrl(""))) - //openWidgetFromUrl("https://l.bluerock.dev/?comp=11601&type=starters") + //openWidgetFromUrl("https://l.bluerock.dev/?comp=11501&cat=GER_M") } FontLoader {