Make ChooseRoomDialog a SearchPage
Makes it look a bit nicer and more standardised
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
@@ -8,29 +10,20 @@ import org.kde.kirigami as Kirigami
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
SearchPage {
|
||||
id: root
|
||||
|
||||
title: i18nc("@title", "Choose a Room")
|
||||
|
||||
showSearchButton: false
|
||||
|
||||
signal chosen(string roomId)
|
||||
|
||||
required property NeoChatConnection connection
|
||||
|
||||
header: Kirigami.SearchField {
|
||||
onTextChanged: RoomManager.sortFilterRoomListModel.filterText = text
|
||||
model: RoomManager.sortFilterRoomListModel
|
||||
modelDelegate: RoomDelegate {
|
||||
onClicked: root.chosen(currentRoom.id)
|
||||
connection: root.connection
|
||||
}
|
||||
|
||||
ListView {
|
||||
model: RoomManager.sortFilterRoomListModel
|
||||
delegate: RoomDelegate {
|
||||
id: roomDelegate
|
||||
onClicked: {
|
||||
root.chosen(roomDelegate.currentRoom.id);
|
||||
}
|
||||
connection: root.connection
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: Qt.callLater(() => header.forceActiveFocus())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user