2017-10-27 17:44:35 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import Sailfish.Silica 1.0
|
2017-11-01 02:27:48 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
|
|
|
|
BackgroundItem {
|
|
|
|
id: delegate
|
2020-06-03 08:34:33 +03:00
|
|
|
|
2017-11-01 02:27:48 +03:00
|
|
|
signal openUser (string notice)
|
2020-06-03 08:34:33 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
width: parent.width
|
2020-06-03 08:34:33 +03:00
|
|
|
height: Theme.itemSizeMedium
|
2017-10-27 17:44:35 +03:00
|
|
|
|
2017-11-01 02:27:48 +03:00
|
|
|
Rectangle {
|
2017-10-27 17:44:35 +03:00
|
|
|
id: avatar
|
|
|
|
width: Theme.itemSizeExtraSmall
|
|
|
|
height: width
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Theme.horizontalPageMargin
|
2017-11-01 02:27:48 +03:00
|
|
|
color: Theme.highlightDimmerColor
|
|
|
|
Image {
|
|
|
|
id: img
|
|
|
|
opacity: status === Image.Ready ? 1.0 : 0.0
|
|
|
|
Behavior on opacity { FadeAnimator {} }
|
|
|
|
anchors.fill: parent
|
|
|
|
source: model.account_avatar
|
|
|
|
}
|
2020-06-03 08:34:33 +03:00
|
|
|
|
2017-11-01 02:27:48 +03:00
|
|
|
BusyIndicator {
|
|
|
|
size: BusyIndicatorSize.Small
|
|
|
|
opacity: img.status === Image.Ready ? 0.0 : 1.0
|
|
|
|
Behavior on opacity { FadeAnimator {} }
|
|
|
|
running: avatar.status !== Image.Ready;
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
2020-06-03 08:34:33 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2020-05-29 21:05:05 +03:00
|
|
|
onClicked: pageStack.push(Qt.resolvedUrl("./../ProfilePage.qml"), {
|
2020-01-16 00:27:37 +03:00
|
|
|
"display_name": model.account_display_name,
|
2017-10-27 17:44:35 +03:00
|
|
|
"username": model.account_acct,
|
|
|
|
"user_id": model.account_id,
|
2020-05-29 21:05:05 +03:00
|
|
|
"profileImage": model.account_avatar,
|
|
|
|
"profileBackground": model.account_header
|
2017-10-27 17:44:35 +03:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
Column {
|
|
|
|
anchors.left: avatar.right
|
|
|
|
anchors.leftMargin: Theme.paddingLarge
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
height: account_acct.height + display_name.height
|
2020-06-15 11:42:10 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
Label {
|
|
|
|
id: display_name
|
2020-06-15 11:42:10 +03:00
|
|
|
text: if (model.account_display_name + " ") {
|
|
|
|
model.account_username.split("@")[0] + " "
|
|
|
|
} else model.account_display_name
|
|
|
|
color: !pressed ? Theme.primaryColor : Theme.highlightColor
|
2017-10-27 17:44:35 +03:00
|
|
|
font.pixelSize: Theme.fontSizeSmall
|
|
|
|
}
|
2020-06-15 11:42:10 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
Label {
|
|
|
|
id: account_acct
|
|
|
|
text: "@"+model.account_acct
|
|
|
|
color: !pressed ? Theme.secondaryColor : Theme.secondaryHighlightColor
|
|
|
|
anchors.leftMargin: Theme.paddingMedium
|
|
|
|
font.pixelSize: Theme.fontSizeExtraSmall
|
|
|
|
}
|
|
|
|
}
|
2020-06-15 11:42:10 +03:00
|
|
|
|
|
|
|
onClicked: openUser( {
|
2020-01-16 00:27:37 +03:00
|
|
|
"display_name": model.account_display_name,
|
2017-11-01 02:27:48 +03:00
|
|
|
"username": model.account_acct,
|
|
|
|
"user_id": model.account_id,
|
2020-05-29 21:05:05 +03:00
|
|
|
"profileImage": model.account_avatar,
|
|
|
|
"profileBackground": model.account_header
|
2020-06-15 11:42:10 +03:00
|
|
|
} )
|
2020-05-29 21:05:05 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
}
|