Suggest to install more plugins in add things page
This commit is contained in:
parent
a440f25f35
commit
95a7593807
@ -41,8 +41,10 @@ SettingsPageBase {
|
|||||||
|
|
||||||
property Packages packages: engine.systemController.packages
|
property Packages packages: engine.systemController.packages
|
||||||
property alias filter: filterTextField.text
|
property alias filter: filterTextField.text
|
||||||
|
property alias showFilter: filterRow.visible
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: filterRow
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.margins: Style.margins
|
Layout.margins: Style.margins
|
||||||
|
|||||||
@ -150,12 +150,14 @@ Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GroupedListView {
|
GroupedListView {
|
||||||
|
id: listView
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
top: filterPane.bottom
|
top: filterPane.bottom
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
bottomMargin: height
|
||||||
|
|
||||||
model: ThingClassesProxy {
|
model: ThingClassesProxy {
|
||||||
id: thingClassesProxy
|
id: thingClassesProxy
|
||||||
@ -167,6 +169,8 @@ Page {
|
|||||||
groupByInterface: true
|
groupByInterface: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onContentYChanged: print("contentY", contentY, contentHeight, originY)
|
||||||
|
|
||||||
delegate: NymeaItemDelegate {
|
delegate: NymeaItemDelegate {
|
||||||
id: tingClassDelegate
|
id: tingClassDelegate
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -182,5 +186,26 @@ Page {
|
|||||||
root.startWizard(thingClass)
|
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-"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user