moment/harmonyqml/RoomHeader.qml

45 lines
1.2 KiB
QML
Raw Normal View History

2019-03-22 14:28:14 +11:00
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4
Rectangle {
id: root
Layout.fillWidth: true
2019-03-26 09:29:46 +11:00
Layout.minimumHeight: 32
2019-03-22 14:28:14 +11:00
Layout.maximumHeight: Layout.minimumHeight
color: "#BBB"
2019-03-26 09:29:46 +11:00
RowLayout {
2019-03-22 14:28:14 +11:00
id: "row"
2019-03-26 09:29:46 +11:00
spacing: 12
anchors.fill: parent
2019-03-22 14:28:14 +11:00
2019-03-26 09:29:46 +11:00
Avatar {
id: "avatar"
Layout.alignment: Qt.AlignTop
dimmension: root.Layout.minimumHeight
username: chatPage.room.display_name
}
PlainLabel {
id: "roomName"
text: chatPage.room.display_name
font.pixelSize: bigSize
elide: Text.ElideRight
maximumLineCount: 1
Layout.maximumWidth: row.width - row.spacing * (row.children.length - 1) - avatar.width
}
2019-03-22 14:28:14 +11:00
2019-03-26 09:29:46 +11:00
PlainLabel {
id: "roomSubtitle"
text: chatPage.room.subtitle
font.pixelSize: smallSize
elide: Text.ElideRight
maximumLineCount: 1
Layout.maximumWidth: row.width - row.spacing * (row.children.length - 1) - avatar.width - roomName.width
2019-03-22 14:28:14 +11:00
}
2019-03-26 09:29:46 +11:00
Item { Layout.fillWidth: true }
2019-03-22 14:28:14 +11:00
}
}