Index: sources/gui/qml/components/EntryDialog.qml =================================================================== diff -u -r3229695c1c67de600c095d52c6f99dacfafb462d -rac23b968f565c2beeb153ca2d554b8f868634512 --- sources/gui/qml/components/EntryDialog.qml (.../EntryDialog.qml) (revision 3229695c1c67de600c095d52c6f99dacfafb462d) +++ sources/gui/qml/components/EntryDialog.qml (.../EntryDialog.qml) (revision ac23b968f565c2beeb153ca2d554b8f868634512) @@ -35,9 +35,11 @@ property bool closeVisible : true property bool confirmVisible : true + property bool confirmEnabled : true property bool autoHide : false property int autoHideDuration : 1000 + property bool autoHideCancel : false property alias contentRect : _backgroundRect property alias backgroundColor : _backgroundRect.color property alias textColor : _notification.textColor @@ -59,10 +61,31 @@ color : Colors.borderDialog Behavior on opacity { PropertyAnimation{}} onVisibleChanged: { - console.debug("Visible", visible) + if (autoHide && visible) { + _autoHideAnimation.start() + } + if (! visible) if (_keyboard) _keyboard.setVisible(false) notificationText = "" } + onAutoHideCancelChanged: { + console.log("Auto Hide Cancel", _root.autoHideCancel) + if ( _root.autoHideCancel ) { + _autoHideAnimation.stop() + _root.autoHideCancel = false + } + } + + NumberAnimation { id: _autoHideAnimation + running : false + target : _root + property: "opacity" + duration: autoHideDuration + onFinished: { + _root.close() + } + } + MouseArea { id: _modal anchors.fill: parent } @@ -73,13 +96,23 @@ height : Variables.dialogHeight color : Colors.backgroundDialog radius : Variables.dialogRadius + + MouseArea { id: autoHideCancel + anchors.fill: parent + onClicked: { + _autoHideAnimation.stop() + mouse.accepted = false + } + } + Rectangle { id : _headerRect anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right ConfirmButton { id : _confirmButton visible: _root.confirmVisible + enabled: _root.confirmEnabled onClicked : { confirmClicked() _keyboard.setVisible(false) @@ -107,7 +140,7 @@ } } } - } - NotificationBar { id: _notification } + NotificationBarSmall { id: _notification } + } }