2023-07-05 15:17:51 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import StatusQ.Controls 0.1
|
2023-03-07 11:32:45 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2023-07-05 15:17:51 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2023-03-07 11:32:45 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.controls 1.0
|
|
|
|
|
|
|
|
Control {
|
|
|
|
id: root
|
|
|
|
property var model
|
|
|
|
property string tokenName
|
2023-03-31 10:20:23 +00:00
|
|
|
property bool isSelectorMode: false
|
|
|
|
|
2023-04-27 10:12:09 +00:00
|
|
|
signal selfDestructAmountChanged(string walletAddress, int amount)
|
|
|
|
signal selfDestructRemoved(string walletAddress)
|
2023-07-05 15:17:51 +00:00
|
|
|
bottomPadding: 16
|
2023-03-07 11:32:45 +00:00
|
|
|
|
2023-07-05 15:17:51 +00:00
|
|
|
TokenHoldersProxyModel {
|
|
|
|
id: filteredModel
|
|
|
|
sourceModel: root.model
|
|
|
|
searchText: searcher.text
|
2023-03-07 11:32:45 +00:00
|
|
|
|
2023-07-05 15:17:51 +00:00
|
|
|
sortBy: holdersList.sortBy
|
|
|
|
sortOrder: holdersList.sortOrder ? Qt.DescendingOrder : Qt.AscendingOrder
|
2023-03-07 11:32:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
2023-07-05 15:17:51 +00:00
|
|
|
id: column
|
|
|
|
anchors.fill: parent
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.padding
|
2023-07-05 15:17:51 +00:00
|
|
|
spacing: 0
|
|
|
|
StatusBaseText {
|
|
|
|
id: txtLabel
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-07-05 15:17:51 +00:00
|
|
|
wrapMode: Text.Wrap
|
2024-10-15 19:26:12 +00:00
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
2023-07-05 15:17:51 +00:00
|
|
|
color: Theme.palette.baseColor1
|
2023-03-07 11:32:45 +00:00
|
|
|
|
2024-05-28 14:24:08 +00:00
|
|
|
text: qsTr("%1 token hodlers").arg(root.tokenName)
|
2023-03-07 11:32:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SearchBox {
|
|
|
|
id: searcher
|
|
|
|
Layout.fillWidth: true
|
2023-07-05 15:17:51 +00:00
|
|
|
Layout.topMargin: 12
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-07-05 15:17:51 +00:00
|
|
|
visible: !root.empty
|
2023-03-07 11:32:45 +00:00
|
|
|
topPadding: 0
|
|
|
|
bottomPadding: 0
|
|
|
|
minimumHeight: 36 // by design
|
|
|
|
maximumHeight: minimumHeight
|
2023-07-05 15:17:51 +00:00
|
|
|
placeholderText: qsTr("Search hodlers")
|
2023-03-07 11:32:45 +00:00
|
|
|
}
|
2023-03-31 10:20:23 +00:00
|
|
|
StatusBaseText {
|
2023-07-05 15:17:51 +00:00
|
|
|
id: anotherLabel
|
2023-03-31 10:20:23 +00:00
|
|
|
Layout.fillWidth: true
|
2023-07-05 15:17:51 +00:00
|
|
|
Layout.topMargin: 12
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-03-07 11:32:45 +00:00
|
|
|
|
2023-03-31 10:20:23 +00:00
|
|
|
wrapMode: Text.Wrap
|
2024-10-15 19:26:12 +00:00
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
2023-03-31 10:20:23 +00:00
|
|
|
color: Theme.palette.baseColor1
|
2023-07-05 15:17:51 +00:00
|
|
|
visible: (searcher.text.length > 0 && filteredModel.count === 0)
|
|
|
|
text: visible ? qsTr("No hodlers found") : ""
|
2023-03-31 10:20:23 +00:00
|
|
|
}
|
2023-07-05 15:17:51 +00:00
|
|
|
TokenHoldersList {
|
|
|
|
id: holdersList
|
2023-03-07 11:32:45 +00:00
|
|
|
Layout.fillWidth: true
|
2023-05-31 20:58:23 +00:00
|
|
|
Layout.fillHeight: true
|
2023-07-05 15:17:51 +00:00
|
|
|
Layout.topMargin: 12
|
|
|
|
isSelectorMode: root.isSelectorMode
|
|
|
|
model: filteredModel
|
2023-08-17 13:58:04 +00:00
|
|
|
onSelfDestructRemoved: root.selfDestructRemoved(walletAddress)
|
|
|
|
onSelfDestructAmountChanged: root.selfDestructAmountChanged(
|
|
|
|
walletAddress, amount)
|
2023-03-07 11:32:45 +00:00
|
|
|
}
|
2023-07-05 15:17:51 +00:00
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 4
|
|
|
|
Layout.alignment: Qt.AlignBottom
|
|
|
|
color: Theme.palette.baseColor2
|
|
|
|
opacity: holdersList.bottomSeparatorVisible ? 1.0 : 0.0
|
|
|
|
}
|
2023-03-07 11:32:45 +00:00
|
|
|
}
|
|
|
|
}
|