Suggest to install more plugins in add things page

This commit is contained in:
Michael Zanetti 2023-01-15 20:26:18 +01:00
parent a440f25f35
commit 95a7593807
2 changed files with 27 additions and 0 deletions

View File

@ -41,8 +41,10 @@ SettingsPageBase {
property Packages packages: engine.systemController.packages
property alias filter: filterTextField.text
property alias showFilter: filterRow.visible
ColumnLayout {
id: filterRow
Layout.fillWidth: true
RowLayout {
Layout.margins: Style.margins

View File

@ -150,12 +150,14 @@ Page {
}
GroupedListView {
id: listView
anchors {
left: parent.left
top: filterPane.bottom
right: parent.right
bottom: parent.bottom
}
bottomMargin: height
model: ThingClassesProxy {
id: thingClassesProxy
@ -167,6 +169,8 @@ Page {
groupByInterface: true
}
onContentYChanged: print("contentY", contentY, contentHeight, originY)
delegate: NymeaItemDelegate {
id: tingClassDelegate
width: parent.width
@ -182,5 +186,26 @@ Page {
root.startWizard(thingClass)
}
}
EmptyViewPlaceholder {
anchors.centerIn: parent
width: parent.width - Style.margins * 2
opacity: thingClassesProxy.count == 0 || listView.contentY >= listView.contentHeight + listView.originY ? 1 : 0
Behavior on opacity { NumberAnimation { duration: Style.shortAnimationDuration } }
visible: opacity > 0
title: qsTr("Looking for something else?")
text: qsTr("Try to install more plugins.")
imageSource: "/ui/images/save.svg"
buttonText: qsTr("Install plugins")
buttonVisible: packagesFilterModel.count > 0
onButtonClicked: {
pageStack.push(Qt.resolvedUrl("/ui/system/PackageListPage.qml"), {filter: "nymea-plugin-"})
}
PackagesFilterModel {
id: packagesFilterModel
packages: engine.systemController.packages
nameFilter: "nymea-plugin-"
}
}
}
}