minor design fixes and improvenemts

This commit is contained in:
Dorian Zedler 2019-05-21 19:07:54 +02:00
parent 75b193e642
commit 085e184d99

View file

@ -84,14 +84,15 @@ Popup {
NumberAnimation {duration: 200} NumberAnimation {duration: 200}
} }
Component.onCompleted: {
profiles_stack.init()
}
Connections { Connections {
target: root target: root
onOpened: { onOpened: {
if(profiles_stack.depth > 0){ profiles_stack.init()
profiles_stack.clear()
}
profiles_stack.openAthletes()
} }
} }
@ -99,6 +100,15 @@ Popup {
currentItem.opened() currentItem.opened()
} }
function init() {
if(profiles_stack.depth === 0){
profiles_stack.openAthletes()
}
else {
profiles_stack.currentItem.opened()
}
}
function openAthletes() { function openAthletes() {
var athsComp = profileListComp.createObject(null, {}) var athsComp = profileListComp.createObject(null, {})
profiles_stack.push(athsComp) profiles_stack.push(athsComp)
@ -622,27 +632,22 @@ Popup {
anchors { anchors {
left: parent.left left: parent.left
leftMargin: -parent.width * 0.03 leftMargin: -height * 0.3
top:parent.top top:parent.top
topMargin: -parent.height * 0.03 topMargin: anchors.leftMargin
} }
height: parent.height * 0.1 height: topContainerItm.height * 0.8
width: height width: height
glowOpacity: Math.pow( root.opacity, 100 ) glowOpacity: Math.pow( root.opacity, 100 )
backgroundColor: appTheme.style.buttonColor backgroundColor: appTheme.style.buttonColor
image: "qrc:/graphics/icons/back_black.png" image: appTheme.style.backIcon
onClicked: profiles_stack.depth > 1 ? profiles_stack.pop():root.close() onClicked: profiles_stack.depth > 1 ? profiles_stack.pop():root.close()
Behavior on opacity {
NumberAnimation {
duration: 100
}
}
} }
FancyButton { FancyButton {
@ -650,16 +655,17 @@ Popup {
anchors { anchors {
right: parent.right right: parent.right
rightMargin: -parent.width * 0.03 rightMargin: -height * 0.3
top:parent.top top:parent.top
topMargin: -parent.height * 0.03 topMargin: anchors.rightMargin
} }
height: parent.height * 0.1
height: topContainerItm.height * 0.8
width:height width:height
opacity: root.opacity < 1 ? root.opacity : profiles_stack.currentItem.secondButt !== "none" ? 1:0 opacity: root.opacity < 1 ? root.opacity : profiles_stack.currentItem.secondButt !== "none" ? 1:root.opacity
//glowOpacity: Math.pow( root.opacity, 100 ) glowOpacity: root.opacity < 1 ? Math.pow( root.opacity, 100 ) : Math.pow( root.opacity, 100 )
backgroundColor: appTheme.style.buttonColor backgroundColor: appTheme.style.buttonColor
@ -678,7 +684,7 @@ Popup {
color: appTheme.style.textColor color: appTheme.style.textColor
text: "+" text: "+"
font.pixelSize: parent.height font.pixelSize: parent.height * 0.8
} }
onClicked: { onClicked: {
@ -693,8 +699,9 @@ Popup {
} }
Behavior on opacity { Behavior on opacity {
enabled: root.opacity === 1
NumberAnimation { NumberAnimation {
duration: 100 duration: 200
} }
} }
} }