2019-05-05 14:57:56 +02:00
|
|
|
import QtQuick 2.4
|
|
|
|
import QtQuick.Controls 2.1
|
|
|
|
import QtQuick.Controls.Material 2.1
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
|
2019-05-17 16:27:12 +02:00
|
|
|
import "componentCreator.js" as ComponentCreator
|
|
|
|
|
2019-05-05 14:57:56 +02:00
|
|
|
ColumnLayout {
|
2019-05-06 20:16:20 +02:00
|
|
|
property var profile
|
|
|
|
|
2019-05-05 14:57:56 +02:00
|
|
|
RowLayout {
|
|
|
|
id: accountLayout
|
|
|
|
spacing: 16
|
|
|
|
Layout.topMargin: 16
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
Layout.bottomMargin: 4
|
|
|
|
ImageButton {
|
2019-05-06 20:16:20 +02:00
|
|
|
height: 64
|
|
|
|
width: 64
|
2019-05-05 14:57:56 +02:00
|
|
|
opacity: 1.0
|
2019-05-09 05:36:15 +02:00
|
|
|
roundness: 4
|
2019-05-05 14:57:56 +02:00
|
|
|
horizontalAlignment: Image.AlignHCenter
|
|
|
|
verticalAlignment: Image.AlignVCenter
|
2019-05-06 20:16:20 +02:00
|
|
|
source: profile.avatar
|
2019-05-05 14:57:56 +02:00
|
|
|
sourceSize.height: 64
|
|
|
|
onClicked: function() {
|
2019-05-06 20:16:20 +02:00
|
|
|
uiBridge.loadAccount(profile.profileID)
|
2020-03-01 11:21:17 +01:00
|
|
|
ComponentCreator.createAccountPopup(mainWindow).open();
|
2019-05-05 14:57:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
2019-05-06 20:16:20 +02:00
|
|
|
text: profile.name
|
2019-05-09 05:37:31 +02:00
|
|
|
font.pointSize: 13
|
2019-05-05 14:57:56 +02:00
|
|
|
font.bold: true
|
|
|
|
elide: Label.ElideRight
|
|
|
|
}
|
|
|
|
Label {
|
2019-05-09 01:00:02 +02:00
|
|
|
text: profile.username + (profile.followedBy ? " (follows you)" : "")
|
2019-05-09 05:37:31 +02:00
|
|
|
font.pointSize: 11
|
2019-05-05 14:57:56 +02:00
|
|
|
opacity: 0.7
|
|
|
|
elide: Label.ElideRight
|
|
|
|
}
|
|
|
|
}
|
2019-05-09 01:00:02 +02:00
|
|
|
Button {
|
|
|
|
id: followButton
|
|
|
|
Layout.alignment: Qt.AlignBottom | Qt.AlignRight
|
|
|
|
visible: profile.profileID != accountBridge.profileID
|
|
|
|
highlighted: true
|
|
|
|
text: profile.following ? qsTr("Unfollow") : qsTr("Follow")
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
uiBridge.followButton(profile.profileID, !profile.following)
|
|
|
|
}
|
|
|
|
}
|
2019-05-05 14:57:56 +02:00
|
|
|
}
|
|
|
|
RowLayout {
|
2019-05-13 08:05:50 +02:00
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2019-05-05 14:57:56 +02:00
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
2019-05-06 20:16:20 +02:00
|
|
|
text: "<b>" + profile.posts + "</b> Posts"
|
2019-05-09 05:37:31 +02:00
|
|
|
font.pointSize: 10
|
2019-05-05 14:57:56 +02:00
|
|
|
elide: Label.ElideRight
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignCenter
|
2019-05-09 00:34:27 +02:00
|
|
|
text: "<b>" + profile.followCount + "</b> Follows"
|
2019-05-09 05:37:31 +02:00
|
|
|
font.pointSize: 10
|
2019-05-05 14:57:56 +02:00
|
|
|
elide: Label.ElideRight
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
2019-05-09 00:34:27 +02:00
|
|
|
text: "<b>" + profile.followerCount + "</b> Followers"
|
2019-05-09 05:37:31 +02:00
|
|
|
font.pointSize: 10
|
2019-05-05 14:57:56 +02:00
|
|
|
elide: Label.ElideRight
|
|
|
|
}
|
2019-05-13 08:05:50 +02:00
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2019-05-05 14:57:56 +02:00
|
|
|
}
|
|
|
|
}
|