2019-03-22 14:28:14 +11:00
|
|
|
import QtQuick 2.7
|
|
|
|
import QtQuick.Controls 2.0
|
|
|
|
import QtQuick.Layouts 1.4
|
2019-03-26 20:52:43 +11:00
|
|
|
import "../base" as Base
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-03-26 18:19:55 +11:00
|
|
|
ColumnLayout {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: accountDelegate
|
2019-03-26 18:19:55 +11:00
|
|
|
spacing: 0
|
|
|
|
width: parent.width
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-03-26 18:19:55 +11:00
|
|
|
RowLayout {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: row
|
2019-03-26 18:19:55 +11:00
|
|
|
spacing: 0
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-04-29 01:32:02 +10:00
|
|
|
Base.HAvatar { id: avatar; name: displayName; dimension: 36 }
|
2019-03-26 09:29:46 +11:00
|
|
|
|
|
|
|
ColumnLayout {
|
2019-03-26 18:19:55 +11:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
spacing: 0
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-03-26 20:52:43 +11:00
|
|
|
Base.HLabel {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: accountLabel
|
2019-04-21 07:36:21 +10:00
|
|
|
text: displayName.value || userId
|
2019-03-26 09:29:46 +11:00
|
|
|
elide: Text.ElideRight
|
|
|
|
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-03-26 09:29:46 +11:00
|
|
|
TextField {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: statusEdit
|
2019-04-21 07:36:21 +10:00
|
|
|
text: statusMessage || ""
|
2019-03-26 09:29:46 +11:00
|
|
|
placeholderText: qsTr("Set status message")
|
2019-03-26 18:19:55 +11:00
|
|
|
background: null
|
|
|
|
color: "black"
|
2019-03-26 09:29:46 +11:00
|
|
|
selectByMouse: true
|
|
|
|
font.family: "Roboto"
|
|
|
|
font.pixelSize: 12
|
|
|
|
Layout.fillWidth: true
|
2019-03-26 18:19:55 +11:00
|
|
|
padding: 0
|
|
|
|
leftPadding: accountLabel.leftPadding
|
|
|
|
rightPadding: leftPadding
|
|
|
|
|
|
|
|
onEditingFinished: {
|
2019-04-21 07:36:21 +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-03-26 20:52:43 +11:00
|
|
|
Base.HToolButton {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: toggleExpand
|
2019-03-26 18:19:55 +11:00
|
|
|
iconName: roomList.visible ? "up" : "down"
|
|
|
|
Layout.maximumWidth: 28
|
2019-03-28 07:43:25 +11:00
|
|
|
Layout.minimumHeight: row.height
|
2019-03-26 18:19:55 +11:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
toggleExpand.ToolTip.hide()
|
|
|
|
roomList.visible = ! roomList.visible
|
2019-03-22 14:28:14 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-26 18:19:55 +11:00
|
|
|
|
|
|
|
RoomList {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: roomList
|
2019-03-26 18:19:55 +11:00
|
|
|
visible: true
|
2019-03-28 06:53:29 +11:00
|
|
|
interactive: false // no scrolling
|
2019-04-21 07:36:21 +10:00
|
|
|
forUserId: userId
|
2019-03-26 18:19:55 +11:00
|
|
|
|
|
|
|
Layout.minimumHeight:
|
|
|
|
roomList.visible ?
|
2019-04-13 20:28:24 +10:00
|
|
|
roomList.contentHeight :
|
2019-03-26 18:19:55 +11:00
|
|
|
0
|
|
|
|
Layout.maximumHeight: Layout.minimumHeight
|
|
|
|
|
2019-03-28 09:38:48 +11:00
|
|
|
Layout.minimumWidth:
|
|
|
|
parent.width - Layout.leftMargin - Layout.rightMargin
|
2019-03-26 18:19:55 +11:00
|
|
|
Layout.maximumWidth: Layout.minimumWidth
|
|
|
|
|
|
|
|
Layout.margins: accountList.spacing
|
|
|
|
Layout.leftMargin:
|
|
|
|
sidePane.width < 36 + Layout.margins ? 0 : Layout.margins
|
2019-03-28 09:38:48 +11:00
|
|
|
Layout.rightMargin: 0
|
2019-03-26 18:19:55 +11:00
|
|
|
}
|
2019-03-22 14:28:14 +11:00
|
|
|
}
|