feat(Chat): show 'no search results' message

Closes #1081
This commit is contained in:
Pascal Precht 2020-10-06 11:24:51 +02:00 committed by Iuri Matias
parent a88aea4b11
commit e2bb81885f
1 changed files with 20 additions and 1 deletions

View File

@ -30,6 +30,7 @@ ScrollView {
id: chatGroupsListView id: chatGroupsListView
anchors.top: parent.top anchors.top: parent.top
height: childrenRect.height height: childrenRect.height
visible: height > 0
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
@ -65,9 +66,27 @@ ScrollView {
} }
} }
Rectangle {
id: noSearchResults
anchors.top: parent.top
height: 300
color: "transparent"
visible: !chatGroupsListView.visible && chatGroupsContainer.searchStr !== ""
anchors.left: parent.left
anchors.right: parent.right
StyledText {
font.pixelSize: 15
color: Style.current.darkGrey
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("No search results")
}
}
EmptyView { EmptyView {
width: parent.width width: parent.width
anchors.top: chatGroupsListView.bottom anchors.top: noSearchResults.visible ? noSearchResults.bottom : chatGroupsListView.bottom
anchors.topMargin: Style.current.smallPadding anchors.topMargin: Style.current.smallPadding
} }