2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-06-11 21:23:27 +00:00
|
|
|
import "../../imports"
|
|
|
|
import "../../shared"
|
2020-09-22 14:45:09 +00:00
|
|
|
import "../../shared/status"
|
2020-06-03 20:50:59 +00:00
|
|
|
|
2020-06-11 21:23:27 +00:00
|
|
|
Rectangle {
|
2020-06-03 20:50:59 +00:00
|
|
|
property string username: "Jotaro Kujo"
|
2020-06-11 21:23:27 +00:00
|
|
|
property string address: "0x123345677890987654321123456"
|
|
|
|
property url identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAg0lEQVR4nOzXwQmAMBAFURV7sQybsgybsgyr0QYUlE1g+Mw7ioQMe9lMQwhDaAyhMYTGEJqYkPnrj/t5XE/ft2UdW1yken7MRAyhMYTGEBpDaAyhKe9JbzvSX9WdLWYihtAYQuMLkcYQGkPUScxEDKExhMYQGkNoDKExhMYQmjsAAP//ZfIUZgXTZXQAAAAASUVORK5CYII="
|
2020-06-04 13:00:17 +00:00
|
|
|
property var onAccountSelect: function() {}
|
2020-06-13 15:17:54 +00:00
|
|
|
property var isSelected: function() {}
|
|
|
|
property bool selected: {
|
|
|
|
return isSelected(index, address)
|
|
|
|
}
|
2020-06-11 21:23:27 +00:00
|
|
|
property bool isHovered: false
|
2020-06-03 20:50:59 +00:00
|
|
|
|
2020-09-29 06:39:29 +00:00
|
|
|
id: root
|
2020-06-11 21:23:27 +00:00
|
|
|
height: 64
|
2020-06-03 20:50:59 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
2020-06-11 21:23:27 +00:00
|
|
|
border.width: 0
|
2020-09-29 06:39:29 +00:00
|
|
|
color: getBgColor()
|
2020-07-02 15:14:31 +00:00
|
|
|
radius: Style.current.radius
|
2020-06-03 20:50:59 +00:00
|
|
|
|
2020-09-29 06:39:29 +00:00
|
|
|
function getBgColor() {
|
|
|
|
if (selected) return Style.current.secondaryBackground
|
|
|
|
if (isHovered) return Style.current.backgroundHover
|
|
|
|
return Style.current.transparent
|
|
|
|
}
|
|
|
|
|
2020-09-22 14:45:09 +00:00
|
|
|
StatusImageIdenticon {
|
2020-06-11 21:23:27 +00:00
|
|
|
id: accountImage
|
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-11 21:23:27 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
source: identicon
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-11 21:23:27 +00:00
|
|
|
id: usernameText
|
|
|
|
text: username
|
2020-06-13 15:17:54 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
anchors.right: parent.right
|
2020-09-29 06:39:29 +00:00
|
|
|
anchors.rightMargin: Style.current.padding + radio.width
|
2020-06-11 21:23:27 +00:00
|
|
|
font.pixelSize: 17
|
|
|
|
anchors.top: accountImage.top
|
|
|
|
anchors.left: accountImage.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-11 21:23:27 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-11 21:23:27 +00:00
|
|
|
id: addressText
|
|
|
|
width: 108
|
|
|
|
text: address
|
2020-07-02 15:14:31 +00:00
|
|
|
font.family: Style.current.fontHexRegular.name
|
2020-06-11 21:23:27 +00:00
|
|
|
elide: Text.ElideMiddle
|
|
|
|
anchors.bottom: accountImage.bottom
|
|
|
|
anchors.bottomMargin: 0
|
|
|
|
anchors.left: usernameText.left
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
font.pixelSize: 15
|
2021-03-24 11:42:41 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-11 21:23:27 +00:00
|
|
|
}
|
|
|
|
|
2020-09-29 06:39:29 +00:00
|
|
|
StatusRadioButton {
|
|
|
|
id: radio
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
checked: root.selected
|
|
|
|
isHovered: root.isHovered
|
|
|
|
}
|
|
|
|
|
2020-06-11 21:23:27 +00:00
|
|
|
MouseArea {
|
|
|
|
hoverEnabled: true
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: {
|
|
|
|
onAccountSelect(index)
|
2020-06-03 20:50:59 +00:00
|
|
|
}
|
2020-06-11 21:23:27 +00:00
|
|
|
onEntered: {
|
2020-09-29 06:39:29 +00:00
|
|
|
root.isHovered = true
|
2020-06-03 20:50:59 +00:00
|
|
|
}
|
2020-06-11 21:23:27 +00:00
|
|
|
onExited: {
|
2020-09-29 06:39:29 +00:00
|
|
|
root.isHovered = false
|
2020-06-03 20:50:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-11 21:23:27 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff";height:64;width:450}
|
|
|
|
}
|
|
|
|
##^##*/
|