2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-06-03 16:49:18 +00:00
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
2020-06-03 19:24:07 +00:00
|
|
|
import "../../Chat/ContactsColumn"
|
2020-06-04 16:00:07 +00:00
|
|
|
import "../data/"
|
2020-06-03 16:49:18 +00:00
|
|
|
|
|
|
|
Item {
|
2020-06-18 15:56:53 +00:00
|
|
|
id: modalBody
|
|
|
|
anchors.fill: parent
|
2020-06-03 16:49:18 +00:00
|
|
|
|
2020-06-18 15:56:53 +00:00
|
|
|
SearchBox {
|
|
|
|
id: searchBox
|
|
|
|
customHeight: 36
|
|
|
|
fontPixelSize: 12
|
|
|
|
anchors.top: modalBody.top
|
2020-06-03 16:49:18 +00:00
|
|
|
}
|
|
|
|
|
2020-06-18 15:56:53 +00:00
|
|
|
ListView {
|
2020-07-15 19:38:03 +00:00
|
|
|
id: tokenListView
|
|
|
|
spacing: 0
|
|
|
|
clip: true
|
2020-06-18 15:56:53 +00:00
|
|
|
anchors.top: searchBox.bottom
|
2020-07-15 19:38:03 +00:00
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-06-18 15:56:53 +00:00
|
|
|
anchors.left: parent.left
|
2020-06-03 16:49:18 +00:00
|
|
|
anchors.right: parent.right
|
2020-06-18 15:56:53 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
model: Tokens {}
|
|
|
|
ScrollBar.vertical: ScrollBar { active: true }
|
2020-06-03 16:49:18 +00:00
|
|
|
|
2020-06-18 15:56:53 +00:00
|
|
|
delegate: Component {
|
2020-06-18 16:38:35 +00:00
|
|
|
id: component
|
2020-06-18 15:56:53 +00:00
|
|
|
Item {
|
2020-06-18 16:38:35 +00:00
|
|
|
id: tokenContainer
|
2020-06-18 15:56:53 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-18 15:56:53 +00:00
|
|
|
width: parent.width
|
2020-06-18 16:38:35 +00:00
|
|
|
property bool isVisible: symbol && (searchBox.text == "" || name.toLowerCase().includes(searchBox.text.toLowerCase()) || symbol.toLowerCase().includes(searchBox.text.toLowerCase()))
|
2020-06-03 16:49:18 +00:00
|
|
|
|
2020-06-18 16:38:35 +00:00
|
|
|
visible: isVisible
|
2020-07-02 15:14:31 +00:00
|
|
|
height: isVisible ? 40 + Style.current.smallPadding : 0
|
2020-06-03 16:49:18 +00:00
|
|
|
|
2020-06-18 15:56:53 +00:00
|
|
|
Image {
|
|
|
|
id: assetInfoImage
|
|
|
|
width: 36
|
2020-06-18 16:38:35 +00:00
|
|
|
height: tokenContainer.isVisible !== "" ? 36 : 0
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 0
|
2020-06-18 15:56:53 +00:00
|
|
|
source: hasIcon ? "../../../img/tokens/" + symbol + ".png" : "../../../img/tokens/0-native.png"
|
2020-06-03 17:52:30 +00:00
|
|
|
anchors.left: parent.left
|
2020-06-18 15:56:53 +00:00
|
|
|
anchors.leftMargin: 0
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-18 15:56:53 +00:00
|
|
|
id: assetSymbol
|
|
|
|
text: symbol
|
|
|
|
anchors.left: assetInfoImage.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-18 15:56:53 +00:00
|
|
|
anchors.top: assetInfoImage.top
|
|
|
|
anchors.topMargin: 0
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-18 16:38:35 +00:00
|
|
|
id: assetFullTokenName
|
2020-07-22 20:46:28 +00:00
|
|
|
text: name || ""
|
2020-06-18 16:38:35 +00:00
|
|
|
anchors.bottom: assetInfoImage.bottom
|
|
|
|
anchors.bottomMargin: 0
|
|
|
|
anchors.left: assetInfoImage.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
color: Style.current.darkGrey
|
2020-06-18 16:38:35 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
2020-06-18 15:56:53 +00:00
|
|
|
CheckBox {
|
|
|
|
id: assetCheck
|
|
|
|
checked: walletModel.hasAsset("0x123", symbol)
|
|
|
|
anchors.right: parent.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
2020-06-18 15:56:53 +00:00
|
|
|
onClicked: walletModel.toggleAsset(symbol, assetCheck.checked, address, name, decimals, "eeeeee")
|
2020-06-03 16:49:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-18 15:56:53 +00:00
|
|
|
highlightFollowsCurrentItem: true
|
2020-06-03 16:49:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-06-18 15:56:53 +00:00
|
|
|
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
|
2020-06-03 16:49:18 +00:00
|
|
|
}
|
|
|
|
##^##*/
|