2024-05-06 17:55:11 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2024-06-19 13:13:32 +00:00
|
|
|
import QtQml.Models 2.15
|
2024-05-06 17:55:11 +00:00
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtGraphicalEffects 1.15
|
|
|
|
|
2024-05-21 10:42:50 +00:00
|
|
|
import StatusQ.Core 0.1
|
2024-05-06 17:55:11 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
2024-05-21 10:42:50 +00:00
|
|
|
import StatusQ.Components 0.1
|
2024-05-06 17:55:11 +00:00
|
|
|
|
|
|
|
import shared.controls 1.0
|
|
|
|
|
|
|
|
Popup {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
objectName: "dappsPopup"
|
|
|
|
|
2024-06-19 13:13:32 +00:00
|
|
|
required property DelegateModel delegateModel
|
2024-05-06 17:55:11 +00:00
|
|
|
|
2024-05-06 20:22:43 +00:00
|
|
|
signal pairWCDapp()
|
2024-05-06 17:55:11 +00:00
|
|
|
|
2024-06-19 13:13:32 +00:00
|
|
|
width: 312
|
|
|
|
|
2024-05-06 17:55:11 +00:00
|
|
|
modal: false
|
|
|
|
padding: 8
|
|
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnOutsideClick | Popup.CloseOnPressOutside
|
|
|
|
|
|
|
|
background: Rectangle {
|
2024-05-21 10:42:50 +00:00
|
|
|
id: backgroundContent
|
2024-05-06 17:55:11 +00:00
|
|
|
|
|
|
|
color: Theme.palette.statusMenu.backgroundColor
|
|
|
|
radius: 8
|
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: DropShadow {
|
|
|
|
anchors.fill: parent
|
2024-05-21 10:42:50 +00:00
|
|
|
source: backgroundContent
|
2024-05-06 17:55:11 +00:00
|
|
|
horizontalOffset: 0
|
|
|
|
verticalOffset: 4
|
|
|
|
radius: 12
|
|
|
|
samples: 25
|
|
|
|
spread: 0.2
|
|
|
|
color: Theme.palette.dropShadow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-19 13:13:32 +00:00
|
|
|
contentItem: ColumnLayout {
|
2024-05-21 10:42:50 +00:00
|
|
|
id: mainLayout
|
|
|
|
|
2024-05-06 17:55:11 +00:00
|
|
|
spacing: 8
|
|
|
|
|
|
|
|
ShapeRectangle {
|
2024-05-21 10:42:50 +00:00
|
|
|
id: listPlaceholder
|
|
|
|
|
|
|
|
text: qsTr("Connected dApps will appear here")
|
|
|
|
|
2024-05-06 17:55:11 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: implicitHeight
|
2024-05-21 10:42:50 +00:00
|
|
|
|
|
|
|
visible: listView.count === 0
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 32
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
|
|
|
|
visible: !listPlaceholder.visible
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
text: qsTr("Connected dApps")
|
|
|
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
font.pixelSize: 12
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListView {
|
|
|
|
id: listView
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: contentHeight
|
|
|
|
Layout.maximumHeight: 280
|
|
|
|
|
2024-06-19 13:13:32 +00:00
|
|
|
model: root.delegateModel
|
2024-05-21 10:42:50 +00:00
|
|
|
visible: !listPlaceholder.visible
|
|
|
|
|
|
|
|
ScrollBar.vertical: null
|
2024-05-06 17:55:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
2024-05-31 09:34:59 +00:00
|
|
|
objectName: "connectDappButton"
|
2024-05-06 17:55:11 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: implicitHeight
|
|
|
|
|
|
|
|
text: qsTr("Connect a dApp via WalletConnect")
|
|
|
|
onClicked: {
|
2024-05-06 20:22:43 +00:00
|
|
|
root.pairWCDapp()
|
2024-05-06 17:55:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|