refactor: don't make StatusChatList scrollable by default

This is because we ran into issues where some component compositions
caused scrollviews to be nested which rendered them non-functional.

For now we're rolling back the idea of components being smart enough
to become scrollable by themselves and have StatusQ consumers handle
scroll behaviour.
This commit is contained in:
Pascal Precht 2021-06-22 10:37:59 +02:00
parent e49b58b94d
commit 8a684a7d8a
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 63 additions and 51 deletions

View File

@ -173,13 +173,13 @@ Rectangle {
text: "Chat"
}
StatusChatListAndCategories {
StatusChatList {
anchors.top: headline.bottom
anchors.topMargin: 16
anchors.bottom: parent.bottom
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
chatList.model: demoChatListItems
chatListItems.model: demoChatListItems
selectedChatId: "0"
onChatItemSelected: selectedChatId = id
onChatItemUnmuted: {
@ -247,6 +247,7 @@ Rectangle {
StatusAppTwoPanelLayout {
leftPanel: Item {
id: leftPanel
anchors.fill: parent
StatusChatInfoToolBar {
@ -255,7 +256,7 @@ Rectangle {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
chatInfoButton.title: "Cryptokitties"
chatInfoButton.title: "CryptoKitties"
chatInfoButton.subTitle: "128 Members"
chatInfoButton.image.source: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
chatInfoButton.icon.color: Theme.palette.miscColor6
@ -283,11 +284,21 @@ Rectangle {
}
}
StatusChatListAndCategories {
ScrollView {
id: scrollView
anchors.top: statusChatInfoToolBar.bottom
anchors.topMargin: 8
anchors.bottom: parent.bottom
width: parent.width
width: leftPanel.width
contentHeight: communityCategories.height
clip: true
StatusChatListAndCategories {
id: communityCategories
height: implicitHeight > (leftPanel.height - 64) ? implicitHeight + 8 : leftPanel.height - 64
width: leftPanel.width
chatList.model: demoCommunityChatListItems
categoryList.model: demoCommunityCategoryItems
@ -344,6 +355,7 @@ Rectangle {
}
}
}
}
rightPanel: Item {
anchors.fill: parent

View File

@ -4,11 +4,11 @@ import QtQuick.Controls 2.14
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
ScrollView {
Item {
id: statusChatListAndCategories
clip: true
contentHeight: chatListsAndCategories.height + 8
implicitHeight: chatListsAndCategories.height
implicitWidth: chatListsAndCategories.width
property string selectedChatId: ""
property bool showCategoryActionButtons: false
@ -32,7 +32,7 @@ ScrollView {
MouseArea {
id: sensor
anchors.top: parent.top
width: parent.width
width: statusChatListAndCategories.width
height: statusChatListAndCategories.height
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {