2019-12-19 07:46:16 -04:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-07-13 05:39:01 -04:00
|
|
|
import QtQuick 2.12
|
2019-12-18 04:53:08 -04:00
|
|
|
import "../../../Base"
|
2020-03-06 08:40:48 -04:00
|
|
|
import "../../.."
|
2019-05-12 13:17:42 -04:00
|
|
|
|
2020-03-06 08:40:48 -04:00
|
|
|
MultiviewPane {
|
2019-12-10 14:57:54 -04:00
|
|
|
id: roomPane
|
2019-12-10 16:29:49 -04:00
|
|
|
saveName: "roomPane"
|
2019-12-09 05:25:31 -04:00
|
|
|
edge: Qt.RightEdge
|
2019-12-21 12:46:47 -04:00
|
|
|
|
2020-03-13 01:09:04 -04:00
|
|
|
buttonsBackgroundColor: theme.chat.roomPane.topBar.background
|
|
|
|
background: Rectangle { color: theme.chat.roomPane.background }
|
2019-12-21 12:46:47 -04:00
|
|
|
|
|
|
|
|
2020-03-06 08:40:48 -04:00
|
|
|
buttonRepeater.model: [
|
|
|
|
"members", "files", "notifications", "history", "settings"
|
|
|
|
]
|
2019-07-12 18:15:06 -04:00
|
|
|
|
2020-03-06 08:40:48 -04:00
|
|
|
buttonRepeater.delegate: HButton {
|
|
|
|
height: theme.baseElementsHeight
|
|
|
|
backgroundColor: "transparent"
|
|
|
|
icon.name: "room-view-" + modelData
|
|
|
|
toolTip.text: qsTr(
|
|
|
|
modelData.charAt(0).toUpperCase() + modelData.slice(1)
|
|
|
|
)
|
2019-12-15 13:04:51 -04:00
|
|
|
|
2020-03-06 08:40:48 -04:00
|
|
|
autoExclusive: true
|
|
|
|
checked: swipeView.currentIndex === 0 && index === 0 ||
|
|
|
|
swipeView.currentIndex === 1 && index === 4
|
2019-07-12 18:15:06 -04:00
|
|
|
|
2020-03-06 08:40:48 -04:00
|
|
|
enabled: ["members", "settings"].includes(modelData)
|
2019-12-09 05:25:31 -04:00
|
|
|
|
2020-03-06 08:40:48 -04:00
|
|
|
onClicked: swipeView.currentIndex = Math.min(index, 1)
|
2019-05-12 13:17:42 -04:00
|
|
|
}
|
2020-03-06 08:40:48 -04:00
|
|
|
|
2020-03-17 16:39:29 -04:00
|
|
|
|
|
|
|
function toggleFocus() {
|
|
|
|
if (swipeView.currentItem.keybindFocusItem.activeFocus) {
|
2020-03-17 16:52:14 -04:00
|
|
|
if (roomPane.collapse) roomPane.close()
|
2020-03-17 16:39:29 -04:00
|
|
|
pageLoader.takeFocus()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
roomPane.open()
|
|
|
|
swipeView.currentItem.keybindFocusItem.forceActiveFocus()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-03-06 08:40:48 -04:00
|
|
|
MemberView {}
|
|
|
|
SettingsView { fillAvailableHeight: true }
|
2019-05-12 13:17:42 -04:00
|
|
|
}
|