2021-01-12 17:03:39 +03:00
|
|
|
import QtQuick 2.9
|
2020-10-26 16:57:54 +03:00
|
|
|
import QtQuick.Controls 2.3
|
2021-01-12 17:03:39 +03:00
|
|
|
import QtQuick.Layouts 1.2
|
2020-10-26 16:57:54 +03:00
|
|
|
import im.nheko 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: topBar
|
|
|
|
|
|
|
|
property var room: TimelineManager.timeline
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
implicitHeight: topLayout.height + 16
|
|
|
|
z: 3
|
|
|
|
color: colors.window
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2021-02-13 16:38:52 +03:00
|
|
|
onClicked: TimelineManager.timeline.openRoomSettings()
|
2020-10-26 16:57:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
//Layout.margins: 8
|
|
|
|
|
|
|
|
id: topLayout
|
|
|
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.margins: 8
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
ImageButton {
|
|
|
|
id: backToRoomsButton
|
|
|
|
|
|
|
|
Layout.column: 0
|
|
|
|
Layout.row: 0
|
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2020-10-28 16:53:11 +03:00
|
|
|
width: avatarSize
|
|
|
|
height: avatarSize
|
2020-10-26 16:57:54 +03:00
|
|
|
visible: TimelineManager.isNarrowView
|
|
|
|
image: ":/icons/icons/ui/angle-pointing-to-left.png"
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.text: qsTr("Back to room list")
|
|
|
|
onClicked: TimelineManager.backToRooms()
|
|
|
|
}
|
|
|
|
|
|
|
|
Avatar {
|
|
|
|
Layout.column: 1
|
|
|
|
Layout.row: 0
|
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
width: avatarSize
|
|
|
|
height: avatarSize
|
|
|
|
url: room ? room.roomAvatarUrl.replace("mxc://", "image://MxcImage/") : ""
|
|
|
|
displayName: room ? room.roomName : qsTr("No room selected")
|
2021-01-12 04:02:39 +03:00
|
|
|
onClicked: TimelineManager.openRoomSettings()
|
2020-10-26 16:57:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.column: 2
|
|
|
|
Layout.row: 0
|
|
|
|
color: colors.text
|
|
|
|
font.pointSize: fontMetrics.font.pointSize * 1.1
|
|
|
|
text: room ? room.roomName : qsTr("No room selected")
|
2020-12-13 18:05:48 +03:00
|
|
|
maximumLineCount: 1
|
|
|
|
elide: Text.ElideRight
|
2020-10-26 16:57:54 +03:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2021-02-12 10:18:12 +03:00
|
|
|
onClicked: TimelineManager.timeline.openRoomSettings()
|
2020-10-26 16:57:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
MatrixText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.column: 2
|
|
|
|
Layout.row: 1
|
|
|
|
Layout.maximumHeight: fontMetrics.lineSpacing * 2 // show 2 lines
|
|
|
|
clip: true
|
|
|
|
text: room ? room.roomTopic : ""
|
|
|
|
}
|
|
|
|
|
|
|
|
ImageButton {
|
|
|
|
id: roomOptionsButton
|
|
|
|
|
|
|
|
Layout.column: 3
|
|
|
|
Layout.row: 0
|
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
image: ":/icons/icons/ui/vertical-ellipsis.png"
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.text: qsTr("Room options")
|
|
|
|
onClicked: roomOptionsMenu.popup(roomOptionsButton)
|
|
|
|
|
|
|
|
Menu {
|
|
|
|
id: roomOptionsMenu
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Invite users")
|
|
|
|
onTriggered: TimelineManager.openInviteUsersDialog()
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Members")
|
|
|
|
onTriggered: TimelineManager.openMemberListDialog()
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Leave room")
|
|
|
|
onTriggered: TimelineManager.openLeaveRoomDialog()
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Settings")
|
2021-02-12 10:18:12 +03:00
|
|
|
onTriggered: TimelineManager.timeline.openRoomSettings()
|
2020-10-26 16:57:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|