Use Kirigami Placeholder Message instead of a Label in the SMS App

This commit makes use of the Kirigami.PlaceholderMessage component
instead of a QML Label, also moves the placeholder message to be
inside the ListView.
This commit is contained in:
Felipe Kinoshita 2021-06-08 11:30:14 -03:00
parent a6de73d437
commit 0d697a6452
No known key found for this signature in database
GPG key ID: E5FF0D0C1A82B6A1

View file

@ -46,15 +46,6 @@ Kirigami.ScrollablePage
}
]
Label {
id: searchResultIndiactor
visible: deviceConnected && view.count == 0 && view.headerItem.childAt(0, 0).text.length != 0
anchors.centerIn: parent
text: i18nd("kdeconnect-sms", "No matched results found : (")
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
}
ColumnLayout {
id: loadingMessage
visible: deviceConnected && view.count == 0 && view.headerItem.childAt(0, 0).text.length == 0
@ -269,5 +260,12 @@ Kirigami.ScrollablePage
currentIndex = -1
focus = true
}
Kirigami.PlaceholderMessage {
anchors.centerIn: parent
width: parent.width - (Kirigami.Units.largeSpacing * 4)
visible: deviceConnected && view.count == 0 && view.headerItem.childAt(0, 0).text.length != 0
text: i18ndc("kdeconnect-sms", "Placeholder message text when no messages are found", "No matches")
}
}
}