2019-12-19 07:46:16 -04:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-12-09 05:25:31 -04:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
2019-12-18 04:53:08 -04:00
|
|
|
import "../../Base"
|
2019-12-09 05:25:31 -04:00
|
|
|
import "Banners"
|
|
|
|
import "Timeline"
|
|
|
|
import "FileTransfer"
|
|
|
|
|
2020-03-11 10:45:47 -04:00
|
|
|
HColumnPage {
|
2019-12-09 05:25:31 -04:00
|
|
|
id: chatPage
|
|
|
|
leftPadding: 0
|
|
|
|
rightPadding: 0
|
|
|
|
|
2020-03-17 14:48:03 -04:00
|
|
|
onLoadEventListChanged: if (loadEventList) loadedOnce = true
|
|
|
|
|
|
|
|
|
|
|
|
property bool loadedOnce: false
|
2019-12-09 14:13:38 -04:00
|
|
|
|
|
|
|
readonly property alias composer: composer
|
2020-03-17 14:48:03 -04:00
|
|
|
readonly property bool loadEventList:
|
|
|
|
mainUI.mainPane.collapse ?
|
|
|
|
! mainUI.mainPane.visible : ! pageLoader.appearAnimation.running
|
2019-12-09 14:13:38 -04:00
|
|
|
|
2019-12-09 05:25:31 -04:00
|
|
|
|
|
|
|
RoomHeader {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
2020-03-11 12:53:55 -04:00
|
|
|
HLoader {
|
|
|
|
id: eventListLoader
|
|
|
|
opacity: loadEventList ? 1 : 0
|
2020-03-17 14:48:03 -04:00
|
|
|
sourceComponent:
|
|
|
|
loadedOnce || loadEventList ? evListComponent : placeholder
|
2019-12-09 05:25:31 -04:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2020-03-11 12:53:55 -04:00
|
|
|
|
|
|
|
Behavior on opacity { HNumberAnimation {} }
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: placeholder
|
|
|
|
Item {}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: evListComponent
|
|
|
|
EventList {}
|
|
|
|
}
|
2019-12-09 05:25:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
TypingMembersBar {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
TransferList {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.minimumHeight: implicitHeight
|
|
|
|
Layout.preferredHeight: implicitHeight * transferCount
|
|
|
|
Layout.maximumHeight: chatPage.height / 6
|
|
|
|
|
|
|
|
Behavior on Layout.preferredHeight { HNumberAnimation {} }
|
|
|
|
}
|
|
|
|
|
|
|
|
InviteBanner {
|
|
|
|
id: inviteBanner
|
|
|
|
visible: ! chat.roomInfo.left && inviterId
|
|
|
|
inviterId: chat.roomInfo.inviter_id
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
2019-12-12 10:33:52 -04:00
|
|
|
LeftBanner {
|
|
|
|
id: leftBanner
|
|
|
|
visible: chat.roomInfo.left
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
2019-12-09 05:25:31 -04:00
|
|
|
Composer {
|
|
|
|
id: composer
|
2020-03-26 21:23:43 -04:00
|
|
|
eventList: loadEventList ? eventListLoader.item.eventList : null
|
2020-03-11 12:53:55 -04:00
|
|
|
visible:
|
|
|
|
! chat.roomInfo.left && ! chat.roomInfo.inviter_id
|
2019-12-09 05:25:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|