2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-06-02 01:02:50 +00:00
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
2020-09-17 15:55:09 +00:00
|
|
|
import "../../../../shared/status"
|
2020-06-04 16:00:07 +00:00
|
|
|
import "../data/"
|
2020-06-02 01:02:50 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
property string currency: "USD"
|
2020-07-22 20:40:32 +00:00
|
|
|
id: modalBody
|
|
|
|
anchors.fill: parent
|
2020-06-02 01:02:50 +00:00
|
|
|
|
2020-06-04 16:00:07 +00:00
|
|
|
ButtonGroup {
|
|
|
|
id: currencyGroup
|
|
|
|
}
|
|
|
|
|
2020-07-22 20:40:32 +00:00
|
|
|
ListView {
|
|
|
|
anchors.top: parent.top
|
2020-06-02 01:02:50 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-22 20:40:32 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
2020-11-27 20:04:32 +00:00
|
|
|
|
2020-07-22 20:40:32 +00:00
|
|
|
clip: true
|
|
|
|
spacing: 10
|
|
|
|
id: tokenListView
|
|
|
|
model: Currencies {}
|
2020-11-27 20:04:32 +00:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
active: true
|
|
|
|
policy: tokenListView.contentHeight > tokenListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
|
|
|
}
|
2020-11-27 13:49:57 +00:00
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
|
2020-07-22 20:40:32 +00:00
|
|
|
delegate: Component {
|
2020-11-27 20:04:32 +00:00
|
|
|
Rectangle {
|
|
|
|
id: wrapper
|
|
|
|
property bool hovered: false
|
|
|
|
radius: Style.current.radius
|
2021-02-25 14:35:25 +00:00
|
|
|
color: modalBody.currency === key ? Style.current.secondaryBackground : (hovered ? Style.current.backgroundHover: Style.current.transparent)
|
2020-07-22 20:40:32 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 10
|
|
|
|
width: parent.width
|
|
|
|
height: 52
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
text: name + " (" + code + ")"
|
|
|
|
font.pixelSize: 15
|
2020-11-27 20:04:32 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-07-22 20:40:32 +00:00
|
|
|
}
|
2020-06-04 16:00:07 +00:00
|
|
|
|
2020-09-17 15:55:09 +00:00
|
|
|
StatusRadioButton {
|
2021-01-14 10:18:12 +00:00
|
|
|
id: currencyRadioBtn
|
2020-07-22 20:40:32 +00:00
|
|
|
checked: currency === key
|
2020-11-27 20:04:32 +00:00
|
|
|
isHovered: wrapper.hovered
|
2020-06-04 16:00:07 +00:00
|
|
|
anchors.right: parent.right
|
2020-11-27 20:04:32 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-07-22 20:40:32 +00:00
|
|
|
ButtonGroup.group: currencyGroup
|
|
|
|
onClicked: { walletModel.setDefaultCurrency(key) }
|
2020-06-04 16:00:07 +00:00
|
|
|
}
|
2020-11-27 20:04:32 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2021-01-14 10:18:12 +00:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
2020-11-27 20:04:32 +00:00
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: {
|
|
|
|
wrapper.hovered = true
|
|
|
|
}
|
|
|
|
onExited: {
|
|
|
|
wrapper.hovered = false
|
|
|
|
}
|
2021-01-14 10:18:12 +00:00
|
|
|
onClicked: {
|
|
|
|
currencyRadioBtn.checked = !currencyRadioBtn.checked
|
|
|
|
modalBody.currency = key
|
|
|
|
walletModel.setDefaultCurrency(key)
|
|
|
|
}
|
2020-11-27 20:04:32 +00:00
|
|
|
}
|
2020-06-04 16:00:07 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-02 01:02:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;autoSize:true;height:480;width:640}
|
|
|
|
}
|
|
|
|
##^##*/
|