moment/src/gui/Chat/RoomPane/RoomPane.qml

80 lines
2.0 KiB
QML
Raw Normal View History

import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
2019-05-13 03:17:42 +10:00
import "../../Base"
2019-12-09 20:25:31 +11:00
HDrawer {
2019-12-11 05:57:54 +11:00
id: roomPane
saveName: "roomPane"
2019-12-09 20:25:31 +11:00
edge: Qt.RightEdge
defaultSize: buttonRepeater.childrenImplicitWidth
minimumSize:
2019-12-09 20:25:31 +11:00
buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0
2019-05-13 03:17:42 +10:00
2019-12-10 02:46:41 +11:00
background: HColumnLayout{
Rectangle {
2019-12-11 05:57:54 +11:00
color: theme.chat.roomPaneButtons.background
2019-12-10 02:46:41 +11:00
Layout.fillWidth: true
Layout.preferredHeight: theme.baseElementsHeight
}
Rectangle {
2019-12-11 05:57:54 +11:00
color: theme.chat.roomPane.background
2019-12-10 02:46:41 +11:00
Layout.fillWidth: true
Layout.fillHeight: true
}
}
2019-12-09 20:25:31 +11:00
HColumnLayout {
anchors.fill: parent
2019-12-09 20:25:31 +11:00
HFlow {
populate: null
2019-12-09 20:25:31 +11:00
Layout.fillWidth: true
2019-12-09 20:25:31 +11:00
HRepeater {
id: buttonRepeater
model: [
"members", "files", "notifications", "history", "settings"
]
HButton {
height: theme.baseElementsHeight
backgroundColor: "transparent"
icon.name: "room-view-" + modelData
toolTip.text: qsTr(
modelData.charAt(0).toUpperCase() + modelData.slice(1)
)
autoExclusive: true
checked: swipeView.currentIndex === 0 && index === 0 ||
swipeView.currentIndex === 1 && index === 4
enabled: ["members", "settings"].includes(modelData)
onClicked: swipeView.currentIndex = Math.min(index, 1)
2019-12-09 20:25:31 +11:00
}
}
}
HSwipeView {
id: swipeView
clip: true
interactive: ! roomPane.collapsed
saveName: "roomPaneView"
saveId: chat.roomId
2019-12-09 20:25:31 +11:00
Layout.fillWidth: true
Layout.fillHeight: true
MemberView {}
2019-12-14 01:14:54 +11:00
SettingsView { fillAvailableHeight: true }
2019-12-09 20:25:31 +11:00
}
2019-05-13 03:17:42 +10:00
}
}