From 0a67d7550c03216df1dcfdb8590a4c6d3dbd83e6 Mon Sep 17 00:00:00 2001 From: dorian Date: Sat, 15 Jun 2019 14:38:33 +0200 Subject: [PATCH] - minor layout fixes - minor bug fixes --- qml/ProfilesDialog/ProfilesDialog.qml | 4 +-- qml/ProfilesDialog/ProfilesStack.qml | 13 +++++----- qml/ProfilesDialog/ResultListPage.qml | 3 +-- qml/main.qml | 35 ++++++++++++++++++++------- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/qml/ProfilesDialog/ProfilesDialog.qml b/qml/ProfilesDialog/ProfilesDialog.qml index 3c652c3..71fea9e 100644 --- a/qml/ProfilesDialog/ProfilesDialog.qml +++ b/qml/ProfilesDialog/ProfilesDialog.qml @@ -168,7 +168,7 @@ Popup { fontSizeMode: Text.Fit font.pixelSize: headlineUnderline.width * 0.1 - minimumPixelSize: 0 + minimumPixelSize: 1 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter @@ -244,7 +244,7 @@ Popup { onClicked: { switch(profilesStack.currentItem.secondButt){ case "add": - profilesStack.push(addProfileComp) + profilesStack.createAthlete() break case "ok": //speedBackend.createAthlete(fullNameTf.text, userNameTf.text) diff --git a/qml/ProfilesDialog/ProfilesStack.qml b/qml/ProfilesDialog/ProfilesStack.qml index 6cb9ae1..59fb0a4 100644 --- a/qml/ProfilesDialog/ProfilesStack.qml +++ b/qml/ProfilesDialog/ProfilesStack.qml @@ -53,22 +53,23 @@ StackView { profilesStack.push(resComp) } + function createAthlete() { + var createAthleteComp = addProfileComp.createObject(null, {}) + profilesStack.push(createAthleteComp) + } + /*-----List of all profiles-----*/ Component { id: profileListComp - ProfileListPage { - - } + ProfileListPage {} } /*-----Option to add a profile-----*/ Component { id: addProfileComp - AddProfilePage { - - } + AddProfilePage {} } // --- Result View --- diff --git a/qml/ProfilesDialog/ResultListPage.qml b/qml/ProfilesDialog/ResultListPage.qml index a11ed7f..30f5fbd 100644 --- a/qml/ProfilesDialog/ResultListPage.qml +++ b/qml/ProfilesDialog/ResultListPage.qml @@ -57,8 +57,7 @@ RemoteDataListView { backgroundRect.radius: 0 function getDateText(){ - var date = new Date(listData[index]["timestamp"]*1000).toLocaleString(Qt.locale(), "dddd, dd.MMM HH:mm") - return date + return new Date(listData[index]["timestamp"]*1000).toLocaleString(Qt.locale(), "dddd, dd.MMM HH:mm") } Rectangle { diff --git a/qml/main.qml b/qml/main.qml index 9e01649..50b56da 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -144,7 +144,7 @@ Window { font.pixelSize: root.landscape() ? parent.width * 0.15 : parent.height * 0.4 - minimumPixelSize: 0 + minimumPixelSize: 1 Behavior on text { FadeAnimation{ @@ -194,7 +194,7 @@ Window { font.pixelSize: root.landscape() ? parent.width * 0.15 : parent.height * 0.4 - minimumPixelSize: 0 + minimumPixelSize: 1 Behavior on text { enabled: root.state !== "RUNNING" @@ -605,7 +605,7 @@ Window { enabled: height > 0 - height: speedBackend.baseStationState === "connected" ? root.landscape() ? menu_container.width * 0.7:menu_container.height * 0.7:0 + state: speedBackend.baseStationState === "connected" ? "visible":"hidden" width: height onClicked: { @@ -616,15 +616,32 @@ Window { backgroundColor: parent.pressed ? appTheme.style.buttonPressedColor:appTheme.style.buttonColor - Behavior on height { - NumberAnimation { - duration: 200 + states: [ + State { + name: "hidden" + PropertyChanges { + target: profilesButt + height: 0 + } + }, + State { + name: "visible" + PropertyChanges { + target: profilesButt + height: root.landscape() ? menu_container.width * 0.7:menu_container.height * 0.7 + } } - } + ] + + transitions: [ + Transition { + NumberAnimation { + properties: "height" + } + } + ] } } - - } /*----------------------