2019-07-13 05:39:01 -04:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
2019-12-18 04:53:08 -04:00
|
|
|
import "../../Base"
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-08-27 22:46:31 -04:00
|
|
|
Rectangle {
|
2019-07-16 17:08:06 -04:00
|
|
|
implicitHeight: theme.baseElementsHeight
|
2019-12-09 05:25:31 -04:00
|
|
|
color: theme.chat.roomHeader.background
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HRowLayout {
|
2019-04-20 17:45:51 -04:00
|
|
|
id: row
|
2019-03-25 18:29:46 -04:00
|
|
|
anchors.fill: parent
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-07-07 00:24:23 -04:00
|
|
|
HRoomAvatar {
|
2019-04-20 17:45:51 -04:00
|
|
|
id: avatar
|
2019-12-09 05:25:31 -04:00
|
|
|
displayName: chat.roomInfo.display_name
|
|
|
|
mxc: chat.roomInfo.avatar_url
|
2019-04-28 14:20:30 -04:00
|
|
|
Layout.alignment: Qt.AlignTop
|
2019-03-25 18:29:46 -04:00
|
|
|
}
|
|
|
|
|
2019-04-28 15:18:36 -04:00
|
|
|
HLabel {
|
2019-12-09 05:25:31 -04:00
|
|
|
id: nameLabel
|
|
|
|
text: chat.roomInfo.display_name || qsTr("Empty room")
|
2019-07-06 17:50:55 -04:00
|
|
|
font.pixelSize: theme.fontSize.big
|
2019-07-24 02:14:34 -04:00
|
|
|
color: theme.chat.roomHeader.name
|
2019-12-09 05:25:31 -04:00
|
|
|
|
2019-03-25 18:29:46 -04:00
|
|
|
elide: Text.ElideRight
|
2019-07-19 00:10:46 -04:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
2019-12-09 05:25:31 -04:00
|
|
|
leftPadding: theme.spacing
|
|
|
|
rightPadding: leftPadding
|
2019-05-12 13:17:42 -04:00
|
|
|
|
2019-12-09 05:25:31 -04:00
|
|
|
Layout.preferredWidth: Math.min(
|
|
|
|
implicitWidth, row.width - row.spacing - avatar.width
|
2019-05-12 18:59:29 -04:00
|
|
|
)
|
2019-12-09 05:25:31 -04:00
|
|
|
Layout.fillHeight: true
|
2019-09-07 14:14:04 -04:00
|
|
|
|
|
|
|
HoverHandler { id: nameHover }
|
2019-03-25 18:29:46 -04:00
|
|
|
}
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-09-11 16:01:37 -04:00
|
|
|
HRichLabel {
|
2019-12-09 05:25:31 -04:00
|
|
|
id: topicLabel
|
|
|
|
text: chat.roomInfo.topic
|
2019-09-11 16:01:37 -04:00
|
|
|
textFormat: Text.StyledText
|
2019-07-06 17:50:55 -04:00
|
|
|
font.pixelSize: theme.fontSize.small
|
2019-07-24 02:14:34 -04:00
|
|
|
color: theme.chat.roomHeader.topic
|
2019-12-09 05:25:31 -04:00
|
|
|
|
2019-03-25 18:29:46 -04:00
|
|
|
elide: Text.ElideRight
|
2019-07-19 00:10:46 -04:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
2019-12-09 05:25:31 -04:00
|
|
|
rightPadding: nameLabel.rightPadding
|
2019-05-12 13:17:42 -04:00
|
|
|
|
2019-12-09 05:25:31 -04:00
|
|
|
Layout.fillWidth: true
|
2019-07-19 00:10:46 -04:00
|
|
|
Layout.fillHeight: true
|
2019-09-07 14:14:04 -04:00
|
|
|
|
|
|
|
HoverHandler { id: topicHover }
|
|
|
|
}
|
|
|
|
|
|
|
|
HToolTip {
|
|
|
|
visible: text && (nameHover.hovered || topicHover.hovered)
|
2019-12-09 05:25:31 -04:00
|
|
|
label.textFormat: Text.StyledText
|
|
|
|
text: name && topic ? (`${name}<br>${topic}`) : (name || topic)
|
2019-09-07 14:14:04 -04:00
|
|
|
|
|
|
|
readonly property string name:
|
2019-12-09 05:25:31 -04:00
|
|
|
nameLabel.truncated ?
|
|
|
|
(`<b>${chat.roomInfo.display_name}</b>`) : ""
|
2019-05-12 13:17:42 -04:00
|
|
|
|
2019-12-09 05:25:31 -04:00
|
|
|
readonly property string topic:
|
|
|
|
topicLabel.truncated ? chat.roomInfo.topic : ""
|
2019-05-12 13:17:42 -04:00
|
|
|
}
|
2019-03-21 23:28:14 -04:00
|
|
|
}
|
|
|
|
}
|