finished up the layout of the profile and results view

This commit is contained in:
Dorian Zedler 2019-05-31 19:06:04 +02:00
parent 085e184d99
commit a3f0f13ff3
5 changed files with 64 additions and 22 deletions

BIN
graphics/icons/ok.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -18,7 +18,7 @@
import QtQuick 2.9 import QtQuick 2.9
import QtMultimedia 5.8 import QtMultimedia 5.8
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 2.2 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import com.itsblue.speedclimbingstopwatch 1.0 import com.itsblue.speedclimbingstopwatch 1.0
@ -44,7 +44,6 @@ Popup {
} }
background: Item { background: Item {
RectangularGlow { RectangularGlow {
id: backgroundEffect id: backgroundEffect
glowRadius: 7 glowRadius: 7
@ -64,7 +63,6 @@ Popup {
} }
} }
StackView { StackView {
id: profiles_stack id: profiles_stack
property int text_pixelSize: headlineUnderline.width * 0.08 property int text_pixelSize: headlineUnderline.width * 0.08
@ -75,9 +73,9 @@ Popup {
top: topContainerItm.bottom top: topContainerItm.bottom
left: parent.left left: parent.left
leftMargin: ( parent.width - headlineUnderline.width ) / 2 leftMargin: ( parent.width - headlineUnderline.width ) / 2
//topMargin: headlineUnderline.anchors.topMargin * 1.2 topMargin: headlineUnderline.anchors.topMargin * 1.2
bottom: parent.bottom bottom: parent.bottom
bottomMargin: topContainerItm.height bottomMargin: topContainerItm.height * 0.3
} }
Behavior on opacity { Behavior on opacity {
@ -88,7 +86,6 @@ Popup {
profiles_stack.init() profiles_stack.init()
} }
Connections { Connections {
target: root target: root
onOpened: { onOpened: {
@ -136,8 +133,8 @@ Popup {
profileList.loadData() profileList.loadData()
} }
anchors.fill: parent //anchors.fill: parent
anchors.topMargin: topContainerItm.height * 0.1 //anchors.topMargin: topContainerItm.height * 0.1
loadData: function () { loadData: function () {
status = 905 status = 905
@ -217,6 +214,7 @@ Popup {
anchors { anchors {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
right: parent.right right: parent.right
rightMargin: 7
} }
height: parent.height * 0.6 height: parent.height * 0.6
@ -390,6 +388,9 @@ Popup {
signal opened() signal opened()
anchors.margins: 10
clip: true
onOpened: { onOpened: {
loadData() loadData()
@ -474,20 +475,28 @@ Popup {
} }
/*-----Custom animations-----*/ /*-----Custom animations-----*/
property int animationDuration: 200
pushEnter: Transition { pushEnter: Transition {
NumberAnimation { NumberAnimation {
property: "opacity" property: "opacity"
from: 0 from: 0
to: 1 to: 1
duration: 300 duration: profiles_stack.animationDuration
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
NumberAnimation { /*NumberAnimation {
property: "x" property: "x"
from: width * 0.1 from: width * 0.1
to: 0 to: 0
duration: 300 duration: 300
}*/
NumberAnimation {
property: "scale"
from: 1.1
to: 1
duration: profiles_stack.animationDuration
} }
} }
pushExit: Transition { pushExit: Transition {
@ -495,15 +504,22 @@ Popup {
property: "opacity" property: "opacity"
from: 1 from: 1
to: 0 to: 0
duration: 300 duration: profiles_stack.animationDuration
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
NumberAnimation { /*NumberAnimation {
property: "x" property: "x"
to: -width * 0.1 to: -width * 0.1
from: 0 from: 0
duration: 300 duration: 300
}*/
NumberAnimation {
property: "scale"
from: 1
to: 0.9
duration: profiles_stack.animationDuration
} }
} }
@ -512,14 +528,22 @@ Popup {
property: "opacity" property: "opacity"
from: 1 from: 1
to: 0 to: 0
duration: 300 duration: profiles_stack.animationDuration
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
NumberAnimation {
/*NumberAnimation {
property: "x" property: "x"
to: width * 0.1 to: width * 0.1
from: 0 from: 0
duration: 300 duration: 300
}*/
NumberAnimation {
property: "scale"
from: 1
to: 1.1
duration: profiles_stack.animationDuration
} }
} }
popEnter: Transition { popEnter: Transition {
@ -527,14 +551,22 @@ Popup {
property: "opacity" property: "opacity"
from: 0 from: 0
to: 1 to: 1
duration: 300 duration: profiles_stack.animationDuration
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
NumberAnimation {
/*NumberAnimation {
property: "x" property: "x"
from: -width * 0.1 from: -width * 0.1
to: 0 to: 0
duration: 300 duration: 300
}*/
NumberAnimation {
property: "scale"
from: 0.9
to: 1
duration: profiles_stack.animationDuration
} }
} }
} }
@ -663,13 +695,13 @@ Popup {
height: topContainerItm.height * 0.8 height: topContainerItm.height * 0.8
width: height width: height
opacity: root.opacity < 1 ? root.opacity : profiles_stack.currentItem.secondButt !== "none" ? 1:root.opacity opacity: root.opacity < 1 ? root.opacity : ["ok", "add"].indexOf(profiles_stack.currentItem.secondButt) >= 0 ? 1:0
glowOpacity: root.opacity < 1 ? Math.pow( root.opacity, 100 ) : Math.pow( root.opacity, 100 ) glowOpacity: opacity < 1 ? Math.pow( opacity, 100 ) : Math.pow( opacity, 100 )
backgroundColor: appTheme.style.buttonColor backgroundColor: appTheme.style.buttonColor
image: "qrc:/graphics/icons/ok_black.png" image: appTheme.style.confirmIcon
imageScale: profiles_stack.currentItem.secondButt === "ok" ? 1:0 imageScale: profiles_stack.currentItem.secondButt === "ok" ? 1:0
Label { Label {

View file

@ -11,6 +11,9 @@ Item {
property int status: -1 property int status: -1
property alias contentY: listView.contentY
property alias model: listView.model
signal refresh() signal refresh()
Component.onCompleted: { Component.onCompleted: {
@ -27,6 +30,10 @@ Item {
boundsBehavior: Flickable.DragOverBounds boundsBehavior: Flickable.DragOverBounds
boundsMovement: Flickable.StopAtBounds boundsMovement: Flickable.StopAtBounds
anchors.margins: 1
anchors.rightMargin: 14
clip: true
//enabled: status === 200 || status === 902 //enabled: status === 200 || status === 902
//opacity: enabled ? 1:0 //opacity: enabled ? 1:0

View file

@ -26,5 +26,6 @@
<file>graphics/icons/buzzer.png</file> <file>graphics/icons/buzzer.png</file>
<file>graphics/icons/startpad.png</file> <file>graphics/icons/startpad.png</file>
<file>graphics/icons/user_black.png</file> <file>graphics/icons/user_black.png</file>
<file>graphics/icons/ok.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -35,7 +35,8 @@ AppTheme::AppTheme(QObject *parent) : QObject(parent)
{"buzzerIcon", "qrc:/graphics/icons/buzzer.png"}, {"buzzerIcon", "qrc:/graphics/icons/buzzer.png"},
{"startpadIcon", "qrc:/graphics/icons/startpad.png"}, {"startpadIcon", "qrc:/graphics/icons/startpad.png"},
{"baseStationIcon", "qrc:/graphics/icons/BaseStation.png"}, {"baseStationIcon", "qrc:/graphics/icons/BaseStation.png"},
{"profilesIcon", "qrc:/graphics/icons/user.png"} {"profilesIcon", "qrc:/graphics/icons/user.png"},
{"confirmIcon", "qrc:/graphics/icons/ok.png"}
}; };
this->darkTheme = tmpDarkTheme; this->darkTheme = tmpDarkTheme;
@ -72,7 +73,8 @@ AppTheme::AppTheme(QObject *parent) : QObject(parent)
{"buzzerIcon", "qrc:/graphics/icons/buzzer_black.png"}, {"buzzerIcon", "qrc:/graphics/icons/buzzer_black.png"},
{"startpadIcon", "qrc:/graphics/icons/startpad_black.png"}, {"startpadIcon", "qrc:/graphics/icons/startpad_black.png"},
{"baseStationIcon", "qrc:/graphics/icons/BaseStation_black.png"}, {"baseStationIcon", "qrc:/graphics/icons/BaseStation_black.png"},
{"profilesIcon", "qrc:/graphics/icons/user_black.png"} {"profilesIcon", "qrc:/graphics/icons/user_black.png"},
{"confirmIcon", "qrc:/graphics/icons/ok_black.png"}
}; };
this->lightTheme = tmpLightTheme; this->lightTheme = tmpLightTheme;