2022-02-01 15:28:47 +00:00
import QtQuick 2.14
import StatusQ . Components 0.1
Item {
id: root
anchors.fill: parent
Column {
id: toastArea
anchors.centerIn: parent
spacing: 8
Repeater {
id: toastRepeater
width: parent . width
height: childrenRect . height
model: [
2022-05-05 09:48:32 +00:00
{ "title" : "anna.eth wants to verify your identity" , "subTitle" : "Provide the code in the letter I sent to you on February 1st." , "icon" : "contact" , "loading" : false , "type" : 0 , "url" : "" , "duration" : 0 } ,
{ "title" : "Verification Request Sent" , "subTitle" : "" , "icon" : "checkmark-circle" , "loading" : false , "type" : 1 , "url" : "" , "duration" : 4000 } ,
{ "title" : "Collectible is being minted..." , "subTitle" : "View on Etherscan" , "icon" : "" , "loading" : true , "type" : 0 , "url" : "http://google.com" , "duration" : 0 } ,
{ "title" : "Contact request sent" , "subTitle" : "" , "icon" : "checkmark-circle" , "loading" : false , "type" : 1 , "url" : "" , "duration" : 4000 } ,
2023-07-25 15:31:55 +00:00
{ "title" : "Test User" , "subTitle" : "Hello message..." , "icon" : "" , "loading" : false , "type" : 0 , "url" : "" , "duration" : 4000 } ,
2023-10-17 08:09:01 +00:00
{ "title" : "This device is no longer the control node for the Socks Community" , "subTitle" : "" , "icon" : "info" , "loading" : false , "type" : 0 , "url" : "" , "duration" : 0 } ,
{ "title" : ` This is , but not now , probably later on the road even it doesn ' t make sense , a very long title with < a style = "text-decoration:none" href = "www.qt.io" > hyperlink < / a > . ` , " s u b T i t l e " : " " , " i c o n " : " i n f o " , " l o a d i n g " : f a l s e , " t y p e " : 2 , " u r l " : " " , " d u r a t i o n " : 0 } ,
2022-02-01 15:28:47 +00:00
]
delegate: StatusToastMessage {
primaryText: modelData . title
secondaryText: modelData . subTitle
icon.name: modelData . icon
loading: modelData . loading
type: modelData . type
linkUrl: modelData . url
2022-05-05 09:48:32 +00:00
duration: modelData . duration
2022-02-01 15:28:47 +00:00
onLinkActivated: {
Qt . openUrlExternally ( link ) ;
}
2022-05-05 09:48:32 +00:00
onClose: {
console . warn ( "toast closed: " , modelData . title )
2022-02-01 15:28:47 +00:00
}
2022-06-21 09:24:55 +00:00
onClicked: {
console . warn ( "toast clicked" )
}
2022-02-01 15:28:47 +00:00
}
}
}
}