Files
neochat/src/qml/ChooseRoomDialog.qml
Tobias Fella fc6ea0b779 Port RoomList to TreeView
Use a tree model for the room list

closes network/neochat#156

BUG: 456643
2024-02-19 20:09:43 +00:00

40 lines
887 B
QML

// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
import QtQuick
import QtQuick.Controls
import org.kde.kirigami as Kirigami
import org.kde.neochat
Kirigami.ScrollablePage {
id: root
title: i18nc("@title", "Choose a Room")
signal chosen(string roomId)
required property NeoChatConnection connection
header: Kirigami.SearchField {
onTextChanged: sortModel.filterText = text
}
ListView {
model: SortFilterRoomListModel {
id: sortModel
sourceModel: RoomListModel {
connection: root.connection
}
}
delegate: RoomDelegate {
id: roomDelegate
onClicked: {
root.chosen(roomDelegate.currentRoom.id);
}
connection: root.connection
}
}
}