2019-05-03 04:20:21 +10:00
|
|
|
import QtQuick 2.7
|
2019-04-29 05:45:42 +10:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-04-29 05:18:36 +10:00
|
|
|
import "../Base"
|
2019-07-04 12:31:29 +10:00
|
|
|
import "../utils.js" as Utils
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
Column {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: accountDelegate
|
2019-03-26 18:19:55 +11:00
|
|
|
width: parent.width
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-06-29 08:12:45 +10:00
|
|
|
// Avoid binding loop by using Component.onCompleted
|
|
|
|
property var user: null
|
2019-07-05 06:01:44 +10:00
|
|
|
Component.onCompleted: user = users.getUser(userId)
|
2019-05-12 05:52:56 +10:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
property string roomCategoriesListUserId: userId
|
|
|
|
property bool expanded: true
|
2019-04-29 02:40:18 +10:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HRowLayout {
|
2019-05-03 04:20:21 +10:00
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height
|
2019-04-21 07:45:51 +10:00
|
|
|
id: row
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
HAvatar {
|
|
|
|
id: avatar
|
2019-07-04 12:31:29 +10:00
|
|
|
name: user.displayName || Utils.stripUserId(user.userId)
|
2019-05-03 04:20:21 +10:00
|
|
|
}
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HColumnLayout {
|
2019-03-26 18:19:55 +11:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HLabel {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: accountLabel
|
2019-06-29 08:12:45 +10:00
|
|
|
text: user.displayName || user.userId
|
2019-04-29 05:36:43 +10:00
|
|
|
elide: HLabel.ElideRight
|
2019-03-26 09:29:46 +11:00
|
|
|
maximumLineCount: 1
|
|
|
|
Layout.fillWidth: true
|
2019-03-26 18:19:55 +11:00
|
|
|
leftPadding: 6
|
|
|
|
rightPadding: leftPadding
|
2019-03-26 09:29:46 +11:00
|
|
|
}
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HTextField {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: statusEdit
|
2019-07-05 08:37:15 +10:00
|
|
|
text: user.statusMessage
|
2019-03-26 09:29:46 +11:00
|
|
|
placeholderText: qsTr("Set status message")
|
2019-07-07 07:50:55 +10:00
|
|
|
font.pixelSize: theme.fontSize.small
|
2019-03-26 18:19:55 +11:00
|
|
|
background: null
|
2019-04-29 02:40:18 +10:00
|
|
|
|
2019-03-26 18:19:55 +11:00
|
|
|
padding: 0
|
|
|
|
leftPadding: accountLabel.leftPadding
|
|
|
|
rightPadding: leftPadding
|
2019-04-29 02:40:18 +10:00
|
|
|
Layout.fillWidth: true
|
2019-03-26 18:19:55 +11:00
|
|
|
|
|
|
|
onEditingFinished: {
|
2019-04-29 02:40:18 +10:00
|
|
|
//Backend.setStatusMessage(userId, text)
|
2019-03-26 18:19:55 +11:00
|
|
|
pageStack.forceActiveFocus()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-05-07 10:37:41 +10:00
|
|
|
ExpandButton {
|
|
|
|
expandableItem: accountDelegate
|
2019-04-29 02:08:54 +10:00
|
|
|
Layout.preferredHeight: row.height
|
2019-03-22 14:28:14 +11:00
|
|
|
}
|
|
|
|
}
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
RoomCategoriesList {
|
|
|
|
id: roomCategoriesList
|
2019-03-28 06:53:29 +11:00
|
|
|
interactive: false // no scrolling
|
2019-05-03 04:20:21 +10:00
|
|
|
visible: height > 0
|
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height * (accountDelegate.expanded ? 1 : 0)
|
|
|
|
clip: heightAnimation.running
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
userId: roomCategoriesListUserId
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
Behavior on height {
|
2019-07-07 07:42:04 +10:00
|
|
|
HNumberAnimation { id: heightAnimation }
|
2019-05-03 04:20:21 +10:00
|
|
|
}
|
2019-03-26 18:19:55 +11:00
|
|
|
}
|
2019-03-22 14:28:14 +11:00
|
|
|
}
|