This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
fanny-app/qml/Components/AppToolBar.qml

70 lines
1.7 KiB
QML
Raw Normal View History

2018-06-21 16:41:02 +02:00
import QtQuick 2.6
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1
ToolBar {
2018-07-15 22:03:10 +02:00
id: toolBar
2018-06-21 16:41:02 +02:00
property bool showErrorBar: true
Material.theme: Material.Light
Rectangle {
id: errorField
width: parent.width
height: 30
enabled: app.is_error & app.state !== "notLoggedIn" & showErrorBar
2018-06-21 16:41:02 +02:00
anchors.top: parent.bottom
2018-07-15 22:03:10 +02:00
2018-06-21 16:41:02 +02:00
color: "red"
2018-07-15 22:03:10 +02:00
onEnabledChanged: {
if(enabled){
toolBar.state = 'moveIn'
}
else {
toolBar.state = 'moveOut'
}
}
MouseArea { anchors.fill: parent; onClicked: {
toolBar.state = 'moveOut'
console.log("clicked")
}
}
2018-06-21 16:41:02 +02:00
Text {
2018-07-15 22:03:10 +02:00
anchors {
horizontalCenter: parent.horizontalCenter
2018-07-19 17:19:09 +02:00
verticalCenter: parent.verticalCenter
2018-07-15 22:03:10 +02:00
}
2018-06-21 16:41:02 +02:00
id: errorText
font.family: "Helvetica"
color: "White"
font.pointSize: 8
2018-07-19 17:19:09 +02:00
visible: parent.height !== 0
text: app.error
2018-06-21 16:41:02 +02:00
}
}
2018-07-15 22:03:10 +02:00
states: [
State {
name: "moveOut"
PropertyChanges { target: errorField; height: 0 }
},
State {
name: "moveIn"
PropertyChanges { target: errorField; height: 30 }
}
]
transitions: [
Transition {
to: "moveOut"
NumberAnimation { properties: "height"; easing.type: Easing.InOutQuad; duration: 200 }
},
Transition {
to: "moveIn"
NumberAnimation { properties: "height"; easing.type: Easing.InOutQuad; duration: 200 }
}
]
2018-06-21 16:41:02 +02:00
}