Some more improvements and styling
This commit is contained in:
parent
0b055bc2c1
commit
121589bf29
6 changed files with 98 additions and 65 deletions
|
@ -37,47 +37,25 @@ BusyIndicator {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
property int currentHeight: 0
|
RotationAnimation {
|
||||||
|
target: blueRockHoldIcon
|
||||||
SequentialAnimation {
|
|
||||||
running: control.running
|
running: control.running
|
||||||
loops: Animation.Infinite
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
target: item
|
|
||||||
property: "currentHeight"
|
|
||||||
from: 0
|
|
||||||
to: 800
|
|
||||||
duration: control.animationSpeed
|
duration: control.animationSpeed
|
||||||
}
|
loops: Animation.Infinite
|
||||||
|
from: 0
|
||||||
|
to: 360
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: blueRockHoldIcon
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
spacing: item.width / 9
|
source: "qrc:/icons/blueRockHold.png"
|
||||||
|
mipmap: true
|
||||||
Repeater {
|
|
||||||
id: repeater
|
|
||||||
model: 5
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
|
|
||||||
property double heightMultiplier: Math.abs( Math.sin( ( ((item.currentHeight/100) + (index*(control.formFactor/repeater.model)))) * (Math.PI/8) ) )
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
width: item.width / 9
|
|
||||||
height: ( heightMultiplier ) * ( item.height - 1 ) + 1
|
|
||||||
|
|
||||||
radius: width * 0.5
|
|
||||||
|
|
||||||
color: control.lineColor
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ Item {
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: control.target
|
target: control.target
|
||||||
function onDragEnded(userPosition) {
|
function onDragEnded() {
|
||||||
if(userPosition >= control.dragOutPosition * control.dragRefreshPositionMultiplier){
|
if(userPosition >= control.dragOutPosition * control.dragRefreshPositionMultiplier){
|
||||||
control.state = "refreshing"
|
control.state = "refreshing"
|
||||||
preRefreshTimer.start()
|
preRefreshTimer.start()
|
||||||
|
|
|
@ -46,6 +46,10 @@ Page {
|
||||||
property bool titleIsPageTitle: widgetLd.item !== null && widgetLd.item.hasOwnProperty('titleIsPageTitle') ? widgetLd.item['titleIsPageTitle']:false
|
property bool titleIsPageTitle: widgetLd.item !== null && widgetLd.item.hasOwnProperty('titleIsPageTitle') ? widgetLd.item['titleIsPageTitle']:false
|
||||||
property Component headerComponent: widgetLd.item !== null && widgetLd.item.hasOwnProperty('headerComponent') ? widgetLd.item['headerComponent']:null
|
property Component headerComponent: widgetLd.item !== null && widgetLd.item.hasOwnProperty('headerComponent') ? widgetLd.item['headerComponent']:null
|
||||||
|
|
||||||
|
function onBackRequested() {
|
||||||
|
return !widgetLd.item.hasOwnProperty('onBackRequested') || widgetLd.item.onBackRequested()
|
||||||
|
}
|
||||||
|
|
||||||
property var params
|
property var params
|
||||||
|
|
||||||
property int status: -1
|
property int status: -1
|
||||||
|
@ -360,7 +364,7 @@ Page {
|
||||||
delegate: Button {
|
delegate: Button {
|
||||||
id: catBt
|
id: catBt
|
||||||
|
|
||||||
width: parent.width
|
width: selectorLv.width
|
||||||
height: text !== "" ? selectorLv.delegateHeight:0
|
height: text !== "" ? selectorLv.delegateHeight:0
|
||||||
|
|
||||||
flat: true
|
flat: true
|
||||||
|
|
|
@ -28,6 +28,7 @@ DataListView {
|
||||||
property bool ready
|
property bool ready
|
||||||
|
|
||||||
property string title: (params.nation === "ICC" ? "IFSC":params.nation === "GER" ? "DAV":"SAC") + " " + qsTr("calendar") + " " + control.year
|
property string title: (params.nation === "ICC" ? "IFSC":params.nation === "GER" ? "DAV":"SAC") + " " + qsTr("calendar") + " " + control.year
|
||||||
|
|
||||||
property Component headerComponent: RowLayout {
|
property Component headerComponent: RowLayout {
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
@ -538,7 +539,7 @@ DataListView {
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: control
|
target: control
|
||||||
onDisplayedCompCatsChanged: {
|
function onDisplayedCompCatsChanged() {
|
||||||
//console.log("filters changed")
|
//console.log("filters changed")
|
||||||
//competitionDel.visible = control.displayedCompCats.indexOf(parseInt(competitionDel.thisData['cat_id'])) >= 0
|
//competitionDel.visible = control.displayedCompCats.indexOf(parseInt(competitionDel.thisData['cat_id'])) >= 0
|
||||||
checked = getCheckedState()
|
checked = getCheckedState()
|
||||||
|
|
|
@ -60,16 +60,7 @@ DataListView {
|
||||||
|
|
||||||
enabled: control.widgetData['route_order'] === "-1" && Object.keys(control.widgetData['route_names']).length > 2
|
enabled: control.widgetData['route_order'] === "-1" && Object.keys(control.widgetData['route_names']).length > 2
|
||||||
|
|
||||||
onClicked: {
|
onClicked: speedFlowChartBackgroundRect.toggle()
|
||||||
if(speedFlowChartBackgroundRect.state === "hidden"){
|
|
||||||
speedFlowChartBackgroundRect.state = "visible"
|
|
||||||
control.positionViewAtBeginning()
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
speedFlowChartBackgroundRect.state = "hidden"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
icon.name: "flowchart"
|
icon.name: "flowchart"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,6 +104,14 @@ DataListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onBackRequested() {
|
||||||
|
if(!speedFlowChartBackgroundRect.isVisible())
|
||||||
|
return true
|
||||||
|
|
||||||
|
speedFlowChartBackgroundRect.toggle()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
function getSubtitle() {
|
function getSubtitle() {
|
||||||
var titleString
|
var titleString
|
||||||
|
|
||||||
|
@ -182,7 +181,7 @@ DataListView {
|
||||||
|
|
||||||
enabled: speedFlowChartBackgroundRect.state === "hidden"
|
enabled: speedFlowChartBackgroundRect.state === "hidden"
|
||||||
|
|
||||||
width: parent.width
|
width: control.width
|
||||||
height: 70
|
height: 70
|
||||||
|
|
||||||
text: ""
|
text: ""
|
||||||
|
@ -296,11 +295,13 @@ DataListView {
|
||||||
model: parseInt(widgetData[ "route_num_problems" ])
|
model: parseInt(widgetData[ "route_num_problems" ])
|
||||||
|
|
||||||
function getDataForIcon(index){
|
function getDataForIcon(index){
|
||||||
|
// TODO: clean
|
||||||
var resultString = widgetData[ "participants" ][partDel.ind]["boulder"+(index+1)]
|
var resultString = widgetData[ "participants" ][partDel.ind]["boulder"+(index+1)]
|
||||||
|
var numTrys = widgetData[ "participants" ][partDel.ind]["try"+(index+1)]
|
||||||
|
|
||||||
var resultList = []
|
var resultList = []
|
||||||
|
|
||||||
if( resultString !== undefined){
|
if (resultString !== undefined) {
|
||||||
resultString = resultString.replace("t", "")
|
resultString = resultString.replace("t", "")
|
||||||
resultString = resultString.replace("z", "")
|
resultString = resultString.replace("z", "")
|
||||||
resultString = resultString.replace("b", "")
|
resultString = resultString.replace("b", "")
|
||||||
|
@ -314,6 +315,13 @@ DataListView {
|
||||||
resultList = [-1,-1]
|
resultList = [-1,-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (numTrys !== undefined) {
|
||||||
|
resultList.push(numTrys)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resultList.push(-1)
|
||||||
|
}
|
||||||
|
|
||||||
return resultList
|
return resultList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,6 +457,27 @@ DataListView {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: boulderResTrysLa
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
height: parent.height / 2
|
||||||
|
width: parent.width / 2
|
||||||
|
|
||||||
|
visible: !boulderResZoneLa.visible
|
||||||
|
|
||||||
|
fontSizeMode: Text.Fit
|
||||||
|
font.pixelSize: height
|
||||||
|
minimumPixelSize: 1
|
||||||
|
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
|
text: boulderResCv.resultData[2]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
id: boulderResZoneLa
|
id: boulderResZoneLa
|
||||||
|
|
||||||
|
@ -734,6 +763,20 @@ DataListView {
|
||||||
|
|
||||||
color: Material.background
|
color: Material.background
|
||||||
|
|
||||||
|
function toggle() {
|
||||||
|
if(speedFlowChartBackgroundRect.state === "hidden"){
|
||||||
|
speedFlowChartBackgroundRect.state = "visible"
|
||||||
|
control.positionViewAtBeginning()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
speedFlowChartBackgroundRect.state = "hidden"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isVisible() {
|
||||||
|
return speedFlowChartBackgroundRect.state === "visible"
|
||||||
|
}
|
||||||
|
|
||||||
SpeedFlowChart {
|
SpeedFlowChart {
|
||||||
id: speedFlowChart
|
id: speedFlowChart
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ Window {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
//loadingDl.open()
|
||||||
//app.openAthlete(53139) // dorian: 53139 , rustam: 6933 , helen: 53300
|
//app.openAthlete(53139) // dorian: 53139 , rustam: 6933 , helen: 53300
|
||||||
//openWidget({nation:'GER'})
|
//openWidget({nation:'GER'})
|
||||||
//mainStack.push("Pages/AthleteSearchPage.qml")
|
//mainStack.push("Pages/AthleteSearchPage.qml")
|
||||||
|
@ -130,11 +131,7 @@ Window {
|
||||||
Shortcut {
|
Shortcut {
|
||||||
sequences: ["Esc", "Back"]
|
sequences: ["Esc", "Back"]
|
||||||
enabled: mainStack.depth > 1
|
enabled: mainStack.depth > 1
|
||||||
onActivated: {
|
onActivated: app.goBack()
|
||||||
if(!mainStack.currentItem.locked){
|
|
||||||
mainStack.pop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerConn {
|
ServerConn {
|
||||||
|
@ -224,12 +221,7 @@ Window {
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
onClicked: {
|
onClicked: app.goBack()
|
||||||
if(!mainStack.currentItem.locked){
|
|
||||||
mainStack.pop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
icon.name: "back"
|
icon.name: "back"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,7 +437,7 @@ Window {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog {
|
Popup {
|
||||||
id: loadingDl
|
id: loadingDl
|
||||||
|
|
||||||
x: ( app.width - width ) / 2
|
x: ( app.width - width ) / 2
|
||||||
|
@ -455,6 +447,9 @@ Window {
|
||||||
closePolicy: Dialog.NoAutoClose
|
closePolicy: Dialog.NoAutoClose
|
||||||
|
|
||||||
contentItem: Column {
|
contentItem: Column {
|
||||||
|
|
||||||
|
spacing: 50
|
||||||
|
|
||||||
FancyBusyIndicator {
|
FancyBusyIndicator {
|
||||||
running: true
|
running: true
|
||||||
}
|
}
|
||||||
|
@ -464,10 +459,17 @@ Window {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
font.bold: true
|
font.bold: true
|
||||||
|
color: "white"
|
||||||
|
|
||||||
text: "loading..."
|
text: "loading..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Store {
|
Store {
|
||||||
|
@ -490,17 +492,17 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function landscape(){
|
function landscape() {
|
||||||
return app.height < app.width
|
return app.height < app.width
|
||||||
}
|
}
|
||||||
|
|
||||||
function openWidget(params){
|
function openWidget(params) {
|
||||||
loadingDl.open()
|
loadingDl.open()
|
||||||
|
|
||||||
var calComp = Qt.createComponent("qrc:/Pages/WidgetPage.qml").createObject(null, {"params": params})
|
var calComp = Qt.createComponent("qrc:/Pages/WidgetPage.qml").createObject(null, {"params": params})
|
||||||
app.errorCode = calComp.status
|
app.errorCode = calComp.status
|
||||||
|
|
||||||
if(calComp.ready){
|
if(calComp.ready) {
|
||||||
mainStack.push(calComp)
|
mainStack.push(calComp)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -510,8 +512,8 @@ Window {
|
||||||
loadingDl.close()
|
loadingDl.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultString(string, defaultString){
|
function defaultString(string, defaultString) {
|
||||||
if(string === undefined || string === null){
|
if(string === undefined || string === null) {
|
||||||
return defaultString
|
return defaultString
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -519,6 +521,11 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
if(!mainStack.currentItem.hasOwnProperty('onBackRequested') || mainStack.currentItem.onBackRequested())
|
||||||
|
mainStack.pop()
|
||||||
|
}
|
||||||
|
|
||||||
function getErrorInfo(errorCode) {
|
function getErrorInfo(errorCode) {
|
||||||
|
|
||||||
var infoLevel
|
var infoLevel
|
||||||
|
|
Loading…
Reference in a new issue