2021-05-14 16:23:32 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.3
|
2021-06-06 00:36:08 +03:00
|
|
|
import "components"
|
2021-05-14 16:23:32 +03:00
|
|
|
import im.nheko 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: chatPage
|
|
|
|
|
|
|
|
color: Nheko.colors.window
|
|
|
|
|
2021-06-06 00:36:08 +03:00
|
|
|
AdaptiveLayout {
|
2021-06-08 23:18:51 +03:00
|
|
|
id: adaptiveView
|
|
|
|
|
2021-05-14 16:23:32 +03:00
|
|
|
anchors.fill: parent
|
2021-06-06 00:36:08 +03:00
|
|
|
singlePageMode: width < communityListC.maximumWidth + roomListC.maximumWidth + timlineViewC.minimumWidth
|
2021-06-08 23:18:51 +03:00
|
|
|
pageIndex: Rooms.currentRoom ? 2 : 1
|
2021-05-14 16:23:32 +03:00
|
|
|
|
2021-06-06 00:36:08 +03:00
|
|
|
AdaptiveLayoutElement {
|
|
|
|
id: communityListC
|
|
|
|
|
|
|
|
minimumWidth: Nheko.avatarSize * 2 + Nheko.paddingSmall * 2
|
|
|
|
collapsedWidth: Nheko.avatarSize + Nheko.paddingSmall * 2
|
|
|
|
preferredWidth: Nheko.avatarSize + Nheko.paddingSmall * 2
|
|
|
|
maximumWidth: Nheko.avatarSize * 7 + Nheko.paddingSmall * 2
|
2021-05-14 16:23:32 +03:00
|
|
|
|
2021-06-06 00:36:08 +03:00
|
|
|
Rectangle {
|
|
|
|
color: Nheko.theme.sidebarBackground
|
|
|
|
}
|
2021-05-15 00:35:34 +03:00
|
|
|
|
2021-05-14 16:23:32 +03:00
|
|
|
}
|
|
|
|
|
2021-06-06 00:36:08 +03:00
|
|
|
AdaptiveLayoutElement {
|
|
|
|
id: roomListC
|
|
|
|
|
|
|
|
minimumWidth: Nheko.avatarSize * 5 + Nheko.paddingSmall * 2
|
|
|
|
preferredWidth: Nheko.avatarSize * 5 + Nheko.paddingSmall * 2
|
|
|
|
maximumWidth: Nheko.avatarSize * 10 + Nheko.paddingSmall * 2
|
2021-06-08 23:18:51 +03:00
|
|
|
collapsedWidth: roomlist.avatarSize + 2 * Nheko.paddingMedium
|
2021-06-06 00:36:08 +03:00
|
|
|
|
|
|
|
RoomList {
|
2021-06-08 23:18:51 +03:00
|
|
|
id: roomlist
|
|
|
|
|
|
|
|
collapsed: parent.collapsed
|
2021-06-06 00:36:08 +03:00
|
|
|
}
|
2021-05-14 16:23:32 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-06-06 00:36:08 +03:00
|
|
|
AdaptiveLayoutElement {
|
|
|
|
id: timlineViewC
|
|
|
|
|
|
|
|
minimumWidth: 400
|
|
|
|
|
|
|
|
TimelineView {
|
|
|
|
id: timeline
|
|
|
|
|
2021-06-08 23:18:51 +03:00
|
|
|
showBackButton: adaptiveView.singlePageMode
|
2021-06-06 00:36:08 +03:00
|
|
|
room: Rooms.currentRoom
|
|
|
|
}
|
|
|
|
|
2021-05-15 00:35:34 +03:00
|
|
|
}
|
|
|
|
|
2021-05-14 16:23:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
PrivacyScreen {
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: Settings.privacyScreen
|
|
|
|
screenTimeout: Settings.privacyScreenTimeout
|
|
|
|
timelineRoot: timeline
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|