2019-07-08 13:52:41 +10:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
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-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-07-08 12:41:32 +10:00
|
|
|
property var userInfo: users.find(model.userId)
|
2019-05-12 05:52:56 +10:00
|
|
|
|
2019-05-03 04:20:21 +10:00
|
|
|
property bool expanded: true
|
2019-04-29 02:40:18 +10:00
|
|
|
|
2019-07-13 07:06:37 +10:00
|
|
|
HHighlightRectangle {
|
2019-05-03 04:20:21 +10:00
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-07-13 07:06:37 +10:00
|
|
|
normalColor: theme.sidePane.account.background
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-07-13 07:06:37 +10:00
|
|
|
HRowLayout {
|
|
|
|
id: row
|
|
|
|
width: parent.width
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-07-13 07:06:37 +10:00
|
|
|
HUserAvatar {
|
|
|
|
id: avatar
|
|
|
|
// Need to do this because conflict with the model property
|
|
|
|
Component.onCompleted: userId = model.userId
|
2019-03-26 09:29:46 +11:00
|
|
|
}
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-07-13 07:06:37 +10:00
|
|
|
HColumnLayout {
|
2019-04-29 02:40:18 +10:00
|
|
|
Layout.fillWidth: true
|
2019-07-13 07:06:37 +10:00
|
|
|
Layout.fillHeight: true
|
2019-03-26 18:19:55 +11:00
|
|
|
|
2019-07-13 07:06:37 +10:00
|
|
|
HLabel {
|
|
|
|
id: accountLabel
|
|
|
|
text: userInfo.displayName || model.userId
|
|
|
|
elide: HLabel.ElideRight
|
|
|
|
maximumLineCount: 1
|
|
|
|
Layout.fillWidth: true
|
|
|
|
leftPadding: sidePane.currentSpacing
|
|
|
|
rightPadding: leftPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
HTextField {
|
|
|
|
id: statusEdit
|
|
|
|
text: userInfo.statusMessage
|
|
|
|
placeholderText: qsTr("Set status message")
|
|
|
|
font.pixelSize: theme.fontSize.small
|
|
|
|
background: null
|
|
|
|
|
|
|
|
padding: 0
|
|
|
|
leftPadding: accountLabel.leftPadding
|
|
|
|
rightPadding: leftPadding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
onEditingFinished: {
|
|
|
|
//Backend.setStatusMessage(model.userId, text) TODO
|
|
|
|
pageStack.forceActiveFocus()
|
|
|
|
}
|
2019-03-26 18:19:55 +11:00
|
|
|
}
|
|
|
|
}
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-07-13 07:06:37 +10:00
|
|
|
ExpandButton {
|
|
|
|
id: expandButton
|
|
|
|
expandableItem: accountDelegate
|
|
|
|
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-07-07 14:24:23 +10:00
|
|
|
userId: userInfo.userId
|
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
|
|
|
}
|