harbour-tooter/qml/pages/components/InfoBanner.qml.autosave
molan-git c8ad3f02cc sentBanner
Adds a confirmation banner when sending a Toot
2020-05-24 19:54:46 +02:00

61 lines
1.4 KiB
Text

import QtQuick 2.0
import Sailfish.Silica 1.0
DockedPanel {
id: root
z: 100;
width: parent.width
height: content.height
dock: Dock.Bottom
Rectangle {
id: content
width: root.width
height: infoLabel.height + 4*Theme.paddingMedium
//anchors.topMargin: 20
color: Theme.highlightBackgroundColor
opacity: 1.0
Label {
id: infoLabel
text : ""
color: Theme.primaryColor
font.family: Theme.fontFamilyHeading
font.pixelSize: Theme.fontSizeMedium
//font.weight: Font.Bold
width: parent.width
wrapMode: Text.WrapAnywhere
anchors {
left: parent.left
leftMargin: Theme.horizontalPageMargin
right: parent.right
rightMargin: Theme.ho rizontalPageMargin
verticalCenter: parent.verticalCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: {
root.hide()
autoClose.stop()
}
}
}
function showText(text) {
infoLabel.text = text
root.show()
autoClose.start()
}
Timer {
id: autoClose
interval: 6000
running: false
onTriggered: {
root.hide()
stop()
}
}
}