moment/harmonyqml/components/Chat/RoomHeader.qml

49 lines
1.1 KiB
QML
Raw Normal View History

2019-03-21 23:28:14 -04:00
import QtQuick 2.7
import QtQuick.Layouts 1.3
import "../Base"
2019-03-21 23:28:14 -04:00
HGlassRectangle {
property string displayName: ""
property string topic: ""
id: roomHeader
color: HStyle.chat.roomHeader.background
2019-03-21 23:28:14 -04:00
Layout.fillWidth: true
Layout.preferredHeight: 32
HRowLayout {
id: row
spacing: 8
2019-03-25 18:29:46 -04:00
anchors.fill: parent
2019-03-21 23:28:14 -04:00
HAvatar {
id: avatar
name: displayName
dimension: roomHeader.height
Layout.alignment: Qt.AlignTop
2019-03-25 18:29:46 -04:00
}
HLabel {
id: roomName
text: displayName
font.pixelSize: HStyle.fontSize.big
2019-03-25 18:29:46 -04:00
elide: Text.ElideRight
maximumLineCount: 1
Layout.maximumWidth: row.width - row.totalSpacing - avatar.width
2019-03-25 18:29:46 -04:00
}
2019-03-21 23:28:14 -04:00
HLabel {
id: roomTopic
text: topic
font.pixelSize: HStyle.fontSize.small
2019-03-25 18:29:46 -04:00
elide: Text.ElideRight
maximumLineCount: 1
Layout.maximumWidth:
row.width - row.totalSpacing - avatar.width - roomName.width
2019-03-21 23:28:14 -04:00
}
2019-03-25 18:29:46 -04:00
2019-04-28 15:22:53 -04:00
HSpacer {}
2019-03-21 23:28:14 -04:00
}
}