feat: make ToastButton close only with button and after 4 seconds

This commit is contained in:
Jonathan Rainville 2020-09-11 11:36:22 -04:00 committed by Iuri Matias
parent e184408749
commit f1e1462529
1 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import QtQuick 2.13
import QtGraphicalEffects 1.13 import QtGraphicalEffects 1.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import "../imports" import "../imports"
import "."
Popup { Popup {
property url source: "../app/img/check-circle.svg" property url source: "../app/img/check-circle.svg"
@ -10,6 +11,7 @@ Popup {
property string link: "https://etherscan.io/" property string link: "https://etherscan.io/"
id: root id: root
closePolicy: Popup.NoAutoClose
height: 68 height: 68
padding: 0 padding: 0
margins: 0 margins: 0
@ -17,6 +19,16 @@ Popup {
x: parent.width - width - Style.current.bigPadding x: parent.width - width - Style.current.bigPadding
y: parent.height - height - Style.current.bigPadding y: parent.height - height - Style.current.bigPadding
onOpened: {
timer.setTimeout(function() {
root.close()
}, 4000);
}
Timer {
id: timer
}
background: Rectangle { background: Rectangle {
id: container id: container
radius: Style.current.radius radius: Style.current.radius