diff --git a/nymea-app/ui/system/PackageListPage.qml b/nymea-app/ui/system/PackageListPage.qml index cd3fa118..7ab627dd 100644 --- a/nymea-app/ui/system/PackageListPage.qml +++ b/nymea-app/ui/system/PackageListPage.qml @@ -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 diff --git a/nymea-app/ui/thingconfiguration/NewThingPage.qml b/nymea-app/ui/thingconfiguration/NewThingPage.qml index 8c77ae53..7d250736 100644 --- a/nymea-app/ui/thingconfiguration/NewThingPage.qml +++ b/nymea-app/ui/thingconfiguration/NewThingPage.qml @@ -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-" + } + } } }