-
Notifications
You must be signed in to change notification settings - Fork 8
/
Messagebox.qml
47 lines (40 loc) · 948 Bytes
/
Messagebox.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import QtQuick 2.0
import Sailfish.Silica 1.0
BackgroundItem
{
id: messagebox
z: 20
visible: messageboxVisibility.running
height: Theme.itemSizeSmall + Theme.paddingSmall
anchors.centerIn: parent
onClicked: messageboxVisibility.stop()
Rectangle
{
height: Theme.paddingSmall
width: parent.width
color: Theme.highlightBackgroundColor
}
Rectangle
{
anchors.fill: parent
color: Qt.rgba(0, 0, 0, 0.6)
}
function showMessage(message, delay)
{
messageboxText.text = message
messageboxVisibility.interval = (delay>0) ? delay : 3000
messageboxVisibility.restart()
}
Label
{
id: messageboxText
color: Theme.primaryColor
text: ""
anchors.centerIn: parent
}
Timer
{
id: messageboxVisibility
interval: 3000
}
}