From c22254364e6bc8dc7909b891533d0b8d595bc77d Mon Sep 17 00:00:00 2001 From: molan-git Date: Tue, 9 Jun 2020 12:05:25 +0200 Subject: [PATCH] avoid empty search-results show # results also uf term is entered by user without # --- qml/pages/MainPage.qml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index c809e19..408c939 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -84,7 +84,11 @@ Page { onSearchChanged: { console.log(search) loader.sourceComponent = loading - loader.sourceComponent = search.charAt(0) === "@" ? userListComponent : tagListComponent + if (search.charAt(0) === "@") { + loader.sourceComponent = userListComponent + } else if (search.charAt(0) === "#") { + loader.sourceComponen = tagListComponent + } else { loader.sourceComponent = worldListComponent} } Loader { @@ -183,6 +187,31 @@ Page { } } } + + Component { + id: wordListComponent + MyList { + id: view3 + mdl: ListModel {} + width: parent.width + height: parent.height + onOpenDrawer: infoPanel.open = setDrawer + anchors.fill: parent + currentIndex: -1 // otherwise currentItem will steal focus + header: Item { + id: header + width: headerContainer.width + height: headerContainer.height + Component.onCompleted: headerContainer.parent = header + } + + delegate: VisualContainer + Component.onCompleted: { + view3.type = "timelines/tag/"+tlSearch.search + view3.loadData("append") + } + } + } } }