2019-03-22 14:28:14 +11:00
|
|
|
import QtQuick 2.7
|
2019-04-29 05:45:42 +10:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-04-29 05:18:36 +10:00
|
|
|
import "../Base"
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-05-12 07:51:00 +10:00
|
|
|
HRectangle {
|
2019-04-21 07:36:21 +10:00
|
|
|
property string displayName: ""
|
|
|
|
property string topic: ""
|
|
|
|
|
2019-05-13 03:17:42 +10:00
|
|
|
property bool collapseButtons: width < 480
|
|
|
|
property alias buttonsWidth: viewButtons.width
|
|
|
|
|
2019-04-29 04:20:30 +10:00
|
|
|
id: roomHeader
|
2019-04-29 05:18:36 +10:00
|
|
|
color: HStyle.chat.roomHeader.background
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HRowLayout {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: row
|
2019-03-26 09:29:46 +11:00
|
|
|
anchors.fill: parent
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HAvatar {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: avatar
|
2019-04-21 07:36:21 +10:00
|
|
|
name: displayName
|
2019-04-29 04:20:30 +10:00
|
|
|
dimension: roomHeader.height
|
|
|
|
Layout.alignment: Qt.AlignTop
|
2019-03-26 09:29:46 +11:00
|
|
|
}
|
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HLabel {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: roomName
|
2019-04-21 07:36:21 +10:00
|
|
|
text: displayName
|
2019-04-29 05:18:36 +10:00
|
|
|
font.pixelSize: HStyle.fontSize.big
|
2019-03-26 09:29:46 +11:00
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 1
|
2019-05-13 03:17:42 +10:00
|
|
|
|
|
|
|
Layout.maximumWidth:
|
|
|
|
row.width - Layout.leftMargin * 2 - avatar.width -
|
|
|
|
viewButtons.width -
|
|
|
|
(expandButton.visible ? expandButton.width : 0)
|
|
|
|
Layout.leftMargin: 8
|
2019-03-26 09:29:46 +11:00
|
|
|
}
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-04-29 05:18:36 +10:00
|
|
|
HLabel {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: roomTopic
|
2019-04-21 07:36:21 +10:00
|
|
|
text: topic
|
2019-04-29 05:18:36 +10:00
|
|
|
font.pixelSize: HStyle.fontSize.small
|
2019-03-26 09:29:46 +11:00
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 1
|
2019-05-13 03:17:42 +10:00
|
|
|
|
2019-03-26 20:52:43 +11:00
|
|
|
Layout.maximumWidth:
|
2019-05-13 03:17:42 +10:00
|
|
|
row.width - Layout.leftMargin * 2 - avatar.width -
|
|
|
|
roomName.width - viewButtons.width -
|
|
|
|
(expandButton.visible ? expandButton.width : 0)
|
|
|
|
Layout.leftMargin: 8
|
2019-03-22 14:28:14 +11:00
|
|
|
}
|
2019-03-26 09:29:46 +11:00
|
|
|
|
2019-04-29 05:22:53 +10:00
|
|
|
HSpacer {}
|
2019-05-13 03:17:42 +10:00
|
|
|
|
|
|
|
Row {
|
|
|
|
id: viewButtons
|
|
|
|
Layout.maximumWidth: collapseButtons ? 0 : implicitWidth
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
iconName: "room_view_members"
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
iconName: "room_view_files"
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
iconName: "room_view_notifications"
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
iconName: "room_view_history"
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
iconName: "room_view_settings"
|
|
|
|
}
|
|
|
|
|
|
|
|
Behavior on Layout.maximumWidth {
|
|
|
|
NumberAnimation { id: buttonsAnimation; duration: 150 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
HButton {
|
|
|
|
id: expandButton
|
|
|
|
z: 1
|
|
|
|
anchors.right: parent.right
|
|
|
|
opacity: collapseButtons ? 1 : 0
|
|
|
|
visible: opacity > 0
|
|
|
|
iconName: "reduced_room_buttons"
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
NumberAnimation { duration: buttonsAnimation.duration * 2 }
|
|
|
|
}
|
2019-03-22 14:28:14 +11:00
|
|
|
}
|
|
|
|
}
|