Show last room message as roomDelegate subtitle
This commit is contained in:
@@ -32,8 +32,8 @@ Rectangle {
|
||||
}
|
||||
|
||||
Base.HLabel {
|
||||
id: "roomSubtitle"
|
||||
text: chatPage.room.subtitle
|
||||
id: "roomDescription"
|
||||
text: chatPage.room.description
|
||||
font.pixelSize: smallSize
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
@@ -75,12 +75,13 @@ ColumnLayout {
|
||||
0
|
||||
Layout.maximumHeight: Layout.minimumHeight
|
||||
|
||||
Layout.minimumWidth: parent.width - Layout.leftMargin * 2
|
||||
Layout.minimumWidth:
|
||||
parent.width - Layout.leftMargin - Layout.rightMargin
|
||||
Layout.maximumWidth: Layout.minimumWidth
|
||||
|
||||
Layout.margins: accountList.spacing
|
||||
Layout.leftMargin:
|
||||
sidePane.width < 36 + Layout.margins ? 0 : Layout.margins
|
||||
Layout.rightMargin: Layout.leftMargin
|
||||
Layout.rightMargin: 0
|
||||
}
|
||||
}
|
||||
|
@@ -37,9 +37,25 @@ MouseArea {
|
||||
rightPadding: leftPadding
|
||||
}
|
||||
Base.HLabel {
|
||||
function get_text() {
|
||||
var msgs = Backend.messagesModel[room_id]
|
||||
if (msgs.count < 1) { return "" }
|
||||
|
||||
var msg = msgs.get(-1)
|
||||
var color_ = (msg.sender_id === roomList.user.user_id ?
|
||||
"darkblue" : "purple")
|
||||
|
||||
return "<font color=\"" + color_ + "\">" +
|
||||
Backend.getUser(msg.sender_id).display_name +
|
||||
":</font> " +
|
||||
msg.content
|
||||
}
|
||||
|
||||
id: subtitleLabel
|
||||
visible: text !== ""
|
||||
text: subtitle
|
||||
text: Backend.messagesModel[room_id].reloadThis, get_text()
|
||||
textFormat: Text.StyledText
|
||||
|
||||
font.pixelSize: smallSize
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
Reference in New Issue
Block a user