2019-03-21 23:28:14 -04:00
|
|
|
import QtQuick 2.7
|
2019-04-28 15:45:42 -04:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-04-28 15:18:36 -04:00
|
|
|
import "../Base"
|
2019-04-14 14:09:54 -04:00
|
|
|
import "utils.js" as SidePaneJS
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-03-26 03:19:55 -04:00
|
|
|
MouseArea {
|
2019-04-28 12:40:18 -04:00
|
|
|
id: roomDelegate
|
2019-03-26 03:19:55 -04:00
|
|
|
width: roomList.width
|
2019-05-02 14:20:21 -04:00
|
|
|
height: childrenRect.height
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-05-02 14:20:21 -04:00
|
|
|
onClicked: pageStack.showRoom(roomList.userId, roomList.category, roomId)
|
2019-03-26 03:19:55 -04:00
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HRowLayout {
|
2019-05-02 14:20:21 -04:00
|
|
|
width: parent.width
|
|
|
|
spacing: roomList.spacing
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HAvatar {
|
2019-04-28 12:40:18 -04:00
|
|
|
id: roomAvatar
|
|
|
|
name: displayName
|
|
|
|
}
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HColumnLayout {
|
2019-05-02 14:20:21 -04:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.maximumWidth:
|
|
|
|
parent.width - parent.totalSpacing - roomAvatar.width
|
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HLabel {
|
2019-03-21 23:28:14 -04:00
|
|
|
id: roomLabel
|
2019-04-20 17:36:21 -04:00
|
|
|
text: displayName ? displayName : "<i>Empty room</i>"
|
2019-04-13 08:59:10 -04:00
|
|
|
textFormat: Text.StyledText
|
2019-03-21 23:28:14 -04:00
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 1
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
2019-03-25 18:29:46 -04:00
|
|
|
|
2019-05-02 14:20:21 -04:00
|
|
|
Layout.maximumWidth: parent.width
|
2019-03-21 23:28:14 -04:00
|
|
|
}
|
2019-04-28 12:40:18 -04:00
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HLabel {
|
2019-04-20 17:36:21 -04:00
|
|
|
function getText() {
|
2019-04-21 20:55:24 -04:00
|
|
|
return SidePaneJS.getLastRoomEventText(
|
2019-04-28 12:40:18 -04:00
|
|
|
roomId, roomList.userId
|
2019-04-21 20:55:24 -04:00
|
|
|
)
|
2019-04-14 14:32:51 -04:00
|
|
|
}
|
|
|
|
|
2019-05-06 13:07:00 -04:00
|
|
|
property var lastEvTime: lastEventDateTime
|
|
|
|
onLastEvTimeChanged: subtitleLabel.text = getText()
|
2019-04-14 14:32:51 -04:00
|
|
|
|
2019-03-21 23:28:14 -04:00
|
|
|
id: subtitleLabel
|
|
|
|
visible: text !== ""
|
2019-04-20 17:36:21 -04:00
|
|
|
text: getText()
|
2019-03-27 18:38:48 -04:00
|
|
|
textFormat: Text.StyledText
|
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
font.pixelSize: HStyle.fontSize.small
|
2019-03-21 23:28:14 -04:00
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 1
|
2019-03-25 18:29:46 -04:00
|
|
|
|
2019-05-02 14:20:21 -04:00
|
|
|
Layout.maximumWidth: parent.width
|
2019-03-21 23:28:14 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|