display channel suggestions in main channel list
This commit is contained in:
parent
a3441fb45f
commit
1d8d11a06e
|
@ -64,16 +64,19 @@ Item {
|
||||||
anchors.topMargin: Style.current.padding
|
anchors.topMargin: Style.current.padding
|
||||||
|
|
||||||
function getCurrentIndex() {
|
function getCurrentIndex() {
|
||||||
return channelList.channelListCount > 0 ? 1 : 0
|
// return channelList.channelListCount > 0 ? 1 : 0
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
currentIndex: getCurrentIndex()
|
currentIndex: getCurrentIndex()
|
||||||
|
|
||||||
EmptyView {
|
// ScrollView {
|
||||||
onCloseButtonPressed: function () {
|
// clip: true
|
||||||
contactsStackView.currentIndex = 2
|
// EmptyView {
|
||||||
}
|
// onCloseButtonPressed: function () {
|
||||||
}
|
// contactsStackView.currentIndex = 2
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
ChannelList {
|
ChannelList {
|
||||||
id: channelList
|
id: channelList
|
||||||
|
|
|
@ -4,6 +4,7 @@ import QtQuick.Layouts 1.13
|
||||||
import "../../../../shared"
|
import "../../../../shared"
|
||||||
import "../../../../imports"
|
import "../../../../imports"
|
||||||
import "../components"
|
import "../components"
|
||||||
|
import "./"
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
property alias channelListCount: chatGroupsListView.count
|
property alias channelListCount: chatGroupsListView.count
|
||||||
|
@ -12,16 +13,34 @@ ScrollView {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
|
contentHeight: {
|
||||||
|
return itemId.height
|
||||||
|
}
|
||||||
|
clip: true
|
||||||
|
|
||||||
ListView {
|
Item {
|
||||||
id: chatGroupsListView
|
id: itemId
|
||||||
|
Layout.fillHeight: true
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
// anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.rightMargin: Style.current.padding
|
anchors.rightMargin: Style.current.padding
|
||||||
anchors.leftMargin: Style.current.padding
|
anchors.leftMargin: Style.current.padding
|
||||||
clip: true
|
height: childrenRect.height
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: chatGroupsListView
|
||||||
|
anchors.top: parent.top
|
||||||
|
height: childrenRect.height
|
||||||
|
// anchors.bottom: parent.bottom
|
||||||
|
// anchors.bottom: chatGroupsListView2.top
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.rightMargin: Style.current.padding
|
||||||
|
anchors.leftMargin: Style.current.padding
|
||||||
|
interactive: false
|
||||||
|
// clip: true
|
||||||
model: chatsModel.chats
|
model: chatsModel.chats
|
||||||
delegate: Channel {
|
delegate: Channel {
|
||||||
name: model.name
|
name: model.name
|
||||||
|
@ -52,6 +71,15 @@ ScrollView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmptyView {
|
||||||
|
width: parent.width
|
||||||
|
// height: 500
|
||||||
|
anchors.top: chatGroupsListView.bottom
|
||||||
|
anchors.topMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ProfilePopup {
|
ProfilePopup {
|
||||||
id: profilePopup
|
id: profilePopup
|
||||||
height: 330
|
height: 330
|
||||||
|
|
|
@ -7,9 +7,8 @@ import "../data/channelList.js" as ChannelJSON
|
||||||
import "../../../../shared"
|
import "../../../../shared"
|
||||||
import "../../../../imports"
|
import "../../../../imports"
|
||||||
|
|
||||||
//Item {
|
Item {
|
||||||
ScrollView {
|
// ScrollView {
|
||||||
// id: sview
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
// anchors.top: suggestionsText.bottom
|
// anchors.top: suggestionsText.bottom
|
||||||
|
@ -18,17 +17,20 @@ import "../../../../imports"
|
||||||
// anchors.right: parent.right
|
// anchors.right: parent.right
|
||||||
// anchors.bottom: parent.bottom
|
// anchors.bottom: parent.bottom
|
||||||
|
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
// ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
// ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
||||||
// Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
// Layout.fillWidth: true
|
// Layout.fillWidth: true
|
||||||
|
|
||||||
property var onCloseButtonPressed: function () {}
|
property var onCloseButtonPressed: function () {}
|
||||||
|
|
||||||
id: emptyView
|
id: emptyView
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
contentHeight: {
|
// contentHeight: {
|
||||||
|
height: {
|
||||||
|
if (!visible) return 0
|
||||||
var totalHeight = 0
|
var totalHeight = 0
|
||||||
for (let i = 0; i < sectionRepeater.count; i++) {
|
for (let i = 0; i < sectionRepeater.count; i++) {
|
||||||
totalHeight += sectionRepeater.itemAt(i).height + Style.current.padding
|
totalHeight += sectionRepeater.itemAt(i).height + Style.current.padding
|
||||||
|
@ -52,7 +54,7 @@ import "../../../../imports"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: inviteFriendsContainer
|
id: inviteFriendsContainer
|
||||||
height: 190
|
height: visible ? 190 : 0
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 0
|
anchors.topMargin: 0
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -88,7 +90,7 @@ import "../../../../imports"
|
||||||
anchors.fill: closeImg
|
anchors.fill: closeImg
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
emptyView.onCloseButtonPressed()
|
emptyView.visible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue