8import QtQuick.Controls 2.0 as Controls
9import QtQuick.Layouts 1.2
10import QtGraphicalEffects 1.0
11import "../../constants" 1.0
17 width: background.width
18 height: background.height
20 enabled: appearAnimation.appear
23 horizontalCenter: parent.horizontalCenter
25 bottomMargin: units.gridUnit * 4
28 function showNotification(message, timeout, actionText, callBack) {
32 appearAnimation.running =
false;
33 appearAnimation.appear =
true;
34 appearAnimation.running =
true;
35 if (timeout ==
"short") {
36 timer.interval = 1000;
37 }
else if (timeout ==
"long") {
38 timer.interval = 4500;
39 }
else if (timeout > 0) {
40 timer.interval = timeout;
42 timer.interval = 3000;
44 messageLabel.text = message ? message :
"";
45 actionButton.text = actionText ? actionText :
"";
46 actionButton.callBack = callBack ? callBack :
"";
51 function hideNotification() {
52 appearAnimation.running =
false;
53 appearAnimation.appear =
false;
54 appearAnimation.running =
true;
59 appearAnimation.appear =
false;
60 appearAnimation.running =
true;
72 appearAnimation.appear =
false;
73 appearAnimation.running =
true;
78 property bool appear:
true
82 to: appearAnimation.appear ? 1 : 0
83 duration: units.longDuration
84 easing.type: Easing.InOutQuad
89 to: appearAnimation.appear ? 0 : background.height
90 duration: units.longDuration
91 easing.type: appearAnimation.appear ? Easing.OutQuad : Easing.InQuad
97 width: backgroundRect.width + units.gridUnit
98 height: backgroundRect.height + units.gridUnit
102 anchors.centerIn: parent
103 radius: units.smallSpacing
104 color: Num.sysPalette.base
105 border.color: Num.sysPalette.light
108 width: mainLayout.width + Math.round((height - mainLayout.height))
109 height: Math.max(mainLayout.height + units.smallSpacing*2, units.gridUnit*2)
114 anchors.centerIn: parent
117 width: Math.min(root.parent.width - units.largeSpacing*2, implicitWidth)
121 property var callBack
124 appearAnimation.appear =
false;
125 appearAnimation.running =
true;
134 layer.effect: DropShadow {
137 radius: units.gridUnit
139 color: Num.sysPalette.shadow