Remove duplicated code in QuickSwitcher for RoomDelegate

This commit is contained in:
Carl Schwan
2023-07-12 13:26:25 +02:00
parent 8f81629ac1
commit 6b55e502a0
3 changed files with 19 additions and 41 deletions

View File

@@ -240,6 +240,15 @@ Kirigami.Page {
RoomList.RoomDelegate {
filterText: sortFilterRoomListModel.filterText
height: visible ? implicitHeight : 0
visible: categoryVisible || filterText.length > 0 || Config.mergeRoomList
onClicked: RoomManager.enterRoom(currentRoom)
Keys.onEnterPressed: RoomManager.enterRoom(currentRoom)
Keys.onReturnPressed: RoomManager.enterRoom(currentRoom)
}
}
}

View File

@@ -30,16 +30,8 @@ Delegates.RoundedItemDelegate {
readonly property bool hasNotifications: notificationCount > 0
height: visible ? implicitHeight : 0
visible: root.categoryVisible || root.filterText.length > 0 || Config.mergeRoomList
onClicked: RoomManager.enterRoom(root.currentRoom)
onPressAndHold: createRoomListContextMenu()
Keys.onEnterPressed: RoomManager.enterRoom(root.currentRoom)
Keys.onReturnPressed: RoomManager.enterRoom(root.currentRoom)
TapHandler {
acceptedButtons: Qt.RightButton
acceptedDevices: PointerDevice.Mouse