Spectral/imports/Spectral/Panel/RoomDrawer.qml

243 lines
5.9 KiB
QML
Raw Normal View History

2018-12-07 01:18:42 +00:00
import QtQuick 2.12
2018-12-22 14:25:03 +00:00
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12
2018-10-01 08:07:48 +00:00
import Spectral.Component 2.0
import Spectral.Dialog 2.0
import Spectral.Effect 2.0
2019-04-21 13:21:48 +00:00
import Spectral.Setting 0.1
2018-10-01 08:07:48 +00:00
import Spectral 0.1
2018-09-06 05:25:39 +00:00
Drawer {
property var room
id: roomDrawer
edge: Qt.RightEdge
ColumnLayout {
anchors.fill: parent
2019-04-21 13:21:48 +00:00
anchors.margins: 24
2018-09-06 05:25:39 +00:00
Component {
id: fullScreenImage
FullScreenImage {}
}
2019-04-21 13:21:48 +00:00
RowLayout {
Layout.fillWidth: true
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
spacing: 16
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
Avatar {
Layout.preferredWidth: 72
Layout.preferredHeight: 72
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
hint: room ? room.displayName : "No name"
source: room ? room.avatarMediaId : null
RippleEffect {
anchors.fill: parent
circular: true
onClicked: fullScreenImage.createObject(parent, {"filename": room.diaplayName, "localPath": room.urlToMxcUrl(room.avatarUrl)}).show()
}
2019-04-21 13:21:48 +00:00
}
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
ColumnLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
font.pixelSize: 18
font.bold: true
wrapMode: Label.Wrap
text: room ? room.displayName : "No Name"
color: MPalette.foreground
2019-04-21 13:21:48 +00:00
}
Label {
Layout.fillWidth: true
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
wrapMode: Label.Wrap
text: room ? room.totalMemberCount + " Members" : "No Member Count"
color: MPalette.lighter
}
}
2018-09-06 05:25:39 +00:00
}
2019-04-21 13:21:48 +00:00
MenuSeparator {
2018-09-10 10:29:41 +00:00
Layout.fillWidth: true
}
Control {
2018-09-06 05:25:39 +00:00
Layout.fillWidth: true
padding: 0
2019-04-21 13:21:48 +00:00
contentItem: RowLayout {
spacing: 8
2018-09-06 05:25:39 +00:00
MaterialIcon {
Layout.preferredWidth: 32
Layout.preferredHeight: 32
Layout.alignment: Qt.AlignTop
2018-09-06 05:25:39 +00:00
icon: "\ue88f"
color: MPalette.lighter
}
2019-04-21 13:21:48 +00:00
ColumnLayout {
2019-04-21 13:21:48 +00:00
Layout.fillWidth: true
Label {
Layout.fillWidth: true
2019-04-21 13:21:48 +00:00
wrapMode: Label.Wrap
text: room && room.canonicalAlias ? room.canonicalAlias : "No Canonical Alias"
color: MPalette.accent
}
2019-04-21 13:21:48 +00:00
Label {
Layout.fillWidth: true
2019-04-21 13:21:48 +00:00
wrapMode: Label.Wrap
text: "Main Alias"
color: MPalette.lighter
}
2019-04-21 13:21:48 +00:00
Label {
Layout.fillWidth: true
2018-09-06 05:25:39 +00:00
wrapMode: Label.Wrap
text: room && room.topic ? room.topic : "No Topic"
color: MPalette.foreground
}
2018-09-06 05:25:39 +00:00
Label {
Layout.fillWidth: true
wrapMode: Label.Wrap
text: "Topic"
color: MPalette.lighter
}
2019-04-21 13:21:48 +00:00
}
2018-09-06 05:25:39 +00:00
}
background: RippleEffect {
onPrimaryClicked: roomSettingDialog.createObject(ApplicationWindow.overlay, {"room": room}).open()
}
2018-09-06 05:25:39 +00:00
}
2019-04-21 13:21:48 +00:00
MenuSeparator {
Layout.fillWidth: true
}
2018-09-06 05:25:39 +00:00
RowLayout {
Layout.fillWidth: true
2019-04-21 13:21:48 +00:00
spacing: 8
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
MaterialIcon {
Layout.preferredWidth: 32
Layout.preferredHeight: 32
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
icon: "\ue7ff"
color: MPalette.lighter
2018-09-06 05:25:39 +00:00
}
2019-04-21 13:21:48 +00:00
Label {
Layout.fillWidth: true
wrapMode: Label.Wrap
text: room ? room.totalMemberCount + " Members" : "No Member Count"
color: MPalette.lighter
}
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
ToolButton {
Layout.preferredWidth: 32
Layout.preferredHeight: 32
2018-09-06 05:25:39 +00:00
2019-04-21 13:21:48 +00:00
contentItem: MaterialIcon {
icon: "\ue145"
color: MPalette.lighter
}
onClicked: inviteUserDialog.createObject(ApplicationWindow.overlay, {"room": room}).open()
2018-09-06 05:25:39 +00:00
}
}
2018-10-15 01:56:30 +00:00
AutoListView {
2018-09-06 05:25:39 +00:00
Layout.fillWidth: true
Layout.fillHeight: true
2018-09-26 23:37:09 +00:00
id: userListView
2018-09-06 05:25:39 +00:00
clip: true
boundsBehavior: Flickable.DragOverBounds
2018-09-10 00:06:32 +00:00
model: UserListModel {
room: roomDrawer.room
}
delegate: Item {
2018-11-11 01:55:41 +00:00
width: userListView.width
height: 48
2018-09-06 05:25:39 +00:00
2018-11-11 01:55:41 +00:00
RowLayout {
anchors.fill: parent
anchors.margins: 8
spacing: 12
2018-09-06 05:25:39 +00:00
Avatar {
2018-11-11 01:55:41 +00:00
Layout.preferredWidth: height
Layout.fillHeight: true
2018-09-06 05:25:39 +00:00
source: avatar
2018-11-11 01:55:41 +00:00
hint: name
}
2018-09-26 23:37:09 +00:00
2018-11-11 01:55:41 +00:00
Label {
Layout.fillWidth: true
2018-09-06 05:25:39 +00:00
2018-11-11 01:55:41 +00:00
text: name
color: MPalette.foreground
2018-09-06 05:25:39 +00:00
}
}
2018-09-11 05:14:56 +00:00
RippleEffect {
anchors.fill: parent
onPrimaryClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {"room": room, "user": user}).open()
2018-09-11 05:14:56 +00:00
}
2018-09-06 05:25:39 +00:00
}
ScrollBar.vertical: ScrollBar {}
}
2019-04-21 13:21:48 +00:00
}
2018-09-06 05:25:39 +00:00
Component {
id: roomSettingDialog
2018-09-06 05:25:39 +00:00
RoomSettingsDialog {}
2018-09-06 05:25:39 +00:00
}
Component {
id: userDetailDialog
UserDetailDialog {}
}
Component {
id: inviteUserDialog
InviteUserDialog {}
}
2018-09-06 05:25:39 +00:00
}