Refactor Chat/RoomSidePane

This commit is contained in:
miruka
2019-12-09 05:25:31 -04:00
parent 06a6a4c08d
commit 5609ae2817
27 changed files with 237 additions and 338 deletions

View File

@@ -4,7 +4,6 @@ import "../../utils.js" as Utils
HTileDelegate {
id: memberDelegate
spacing: roomSidePane.currentSpacing
backgroundColor: theme.chat.roomSidePane.member.background
image: HUserAvatar {

View File

@@ -13,7 +13,7 @@ HColumnLayout {
readonly property var originSource:
modelSources[["Member", chatPage.roomId]] || []
modelSources[["Member", chat.roomId]] || []
onOriginSourceChanged: filterLimiter.restart()

View File

@@ -2,17 +2,43 @@ import QtQuick 2.12
import QtQuick.Layouts 1.12
import "../../Base"
Rectangle {
HDrawer {
id: roomSidePane
color: theme.chat.roomSidePane.background
edge: Qt.RightEdge
normalWidth: buttonRepeater.childrenImplicitWidth
minNormalWidth:
buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0
property bool collapsed: false
property var activeView: null
property int currentSpacing: collapsed ? 0 : theme.spacing
Behavior on currentSpacing { HNumberAnimation {} }
MembersView {
HColumnLayout {
anchors.fill: parent
HFlow {
Layout.fillWidth: true
HRepeater {
id: buttonRepeater
model: [
"members", "files", "notifications", "history", "settings"
]
HButton {
height: theme.baseElementsHeight
backgroundColor: "transparent"
icon.name: "room-view-" + modelData
autoExclusive: true
checked: modelData === "members"
enabled: modelData === "members"
toolTip.text: qsTr(
modelData.charAt(0).toUpperCase() + modelData.slice(1)
)
}
}
}
MembersView {
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}