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 {
|
|
|
|
id: "accountDelegate"
|
|
|
|
spacing: 0
|
|
|
|
width: parent.width
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-03-26 18:19:55 +11:00
|
|
|
RowLayout {
|
|
|
|
id: "row"
|
|
|
|
spacing: 0
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-03-28 10:21:14 +11:00
|
|
|
Base.Avatar { id: "avatar"; name: display_name; dimmension: 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-03-26 18:19:55 +11:00
|
|
|
id: "accountLabel"
|
|
|
|
text: display_name
|
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-03-26 18:19:55 +11:00
|
|
|
id: "statusEdit"
|
|
|
|
text: status_message || ""
|
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: {
|
|
|
|
Backend.setStatusMessage(user_id, text)
|
|
|
|
pageStack.forceActiveFocus()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-03-26 20:52:43 +11:00
|
|
|
Base.HToolButton {
|
2019-03-26 18:19:55 +11:00
|
|
|
id: "toggleExpand"
|
|
|
|
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 {
|
|
|
|
id: "roomList"
|
|
|
|
visible: true
|
2019-03-28 06:53:29 +11:00
|
|
|
interactive: false // no scrolling
|
2019-04-12 18:33:09 +10:00
|
|
|
for_user_id: user_id
|
2019-03-26 18:19:55 +11:00
|
|
|
|
|
|
|
Layout.minimumHeight:
|
|
|
|
roomList.visible ?
|
|
|
|
roomList.contentHeight + roomList.anchors.margins * 2 :
|
|
|
|
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
|
|
|
}
|