From 292cfb0d3de22b30b7290456e3ce7634f02fa3fa Mon Sep 17 00:00:00 2001 From: James Graham Date: Fri, 16 Feb 2024 19:48:16 +0000 Subject: [PATCH] Change ExploreComponent to signal text changes and set filterText from there --- src/qml/ExploreComponent.qml | 7 ++++++- src/qml/RoomListPage.qml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/qml/ExploreComponent.qml b/src/qml/ExploreComponent.qml index fc0a74cca..38418d529 100644 --- a/src/qml/ExploreComponent.qml +++ b/src/qml/ExploreComponent.qml @@ -66,13 +66,18 @@ RowLayout { } } + /** + * @brief Emitted when the text is changed in the search field. + */ + signal textChanged(string newText) + Kirigami.SearchField { Layout.topMargin: Kirigami.Units.smallSpacing Layout.bottomMargin: Kirigami.Units.smallSpacing Layout.fillWidth: true Layout.preferredWidth: root.desiredWidth ? root.desiredWidth - menuButton.width - root.spacing : -1 visible: !root.collapsed - onTextChanged: sortFilterRoomListModel.filterText = text + onTextChanged: root.textChanged(text) KeyNavigation.tab: listView } diff --git a/src/qml/RoomListPage.qml b/src/qml/RoomListPage.qml index 0f8d90e21..7f68bb7bf 100644 --- a/src/qml/RoomListPage.qml +++ b/src/qml/RoomListPage.qml @@ -402,6 +402,10 @@ Kirigami.Page { desiredWidth: root.width - Kirigami.Units.largeSpacing collapsed: root.collapsed connection: root.connection + + onTextChanged: newText => { + sortFilterRoomListModel.filterText = newText; + } } }