Delete old space components
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2022 Snehit Sah <snehitsah@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15 as QQC2
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
QQC2.ItemDelegate {
|
||||
id: root
|
||||
|
||||
required property string avatar
|
||||
required property var currentRoom
|
||||
required property int index
|
||||
required property string id
|
||||
|
||||
signal createContextMenu(currentRoom: var)
|
||||
signal spaceSelected(spaceId: string)
|
||||
|
||||
height: ListView.view.height
|
||||
width: height
|
||||
|
||||
leftPadding: topPadding
|
||||
rightPadding: topPadding
|
||||
|
||||
contentItem: Kirigami.Avatar {
|
||||
name: currentRoom.displayName
|
||||
source: avatar !== "" ? "image://mxc/" + avatar : ""
|
||||
}
|
||||
|
||||
onClicked: root.spaceSelected(id)
|
||||
onPressAndHold: root.createContextMenu(root.currentRoom)
|
||||
|
||||
Accessible.name: currentRoom.displayName
|
||||
|
||||
QQC2.ToolTip.text: currentRoom.displayName
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
acceptedDevices: PointerDevice.Mouse
|
||||
onTapped: root.createContextMenu(root.currentRoom)
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2022 Snehit Sah <snehitsah@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15 as QQC2
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
ListView {
|
||||
id: root
|
||||
|
||||
required property RoomListModel roomListModel
|
||||
|
||||
orientation: Qt.Horizontal
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
clip: true
|
||||
visible: root.count > 0
|
||||
|
||||
model: SortFilterSpaceListModel {
|
||||
id: sortFilterSpaceListModel
|
||||
sourceModel: root.roomListModel
|
||||
}
|
||||
|
||||
header: QQC2.ItemDelegate {
|
||||
id: homeButton
|
||||
icon.name: "home"
|
||||
text: i18nc("@action:button", "Show All Rooms")
|
||||
height: parent.height
|
||||
width: height
|
||||
leftPadding: topPadding
|
||||
rightPadding: topPadding
|
||||
|
||||
contentItem: Kirigami.Icon {
|
||||
source: "home"
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
sortFilterRoomListModel.activeSpaceId = "";
|
||||
listView.positionViewAtIndex(0, ListView.Beginning);
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: homeButton.text
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
}
|
||||
|
||||
delegate: SpaceDelegate {
|
||||
onSpaceSelected: (spaceId) => {
|
||||
sortFilterRoomListModel.activeSpaceId = spaceId;
|
||||
}
|
||||
|
||||
onCreateContextMenu: () => {
|
||||
const menu = spaceListContextMenu.createObject(page, {
|
||||
room: currentRoom,
|
||||
});
|
||||
menu.open();
|
||||
}
|
||||
}
|
||||
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
@@ -12,8 +12,6 @@
|
||||
<file alias="RoomList/RoomDelegate.qml">qml/Page/RoomList/RoomDelegate.qml</file>
|
||||
<file alias="RoomList/Page.qml">qml/Page/RoomList/Page.qml</file>
|
||||
<file alias="SpaceListContextMenu.qml">qml/Page/RoomList/SpaceListContextMenu.qml</file>
|
||||
<file alias="RoomList/SpaceDelegate.qml">qml/Page/RoomList/SpaceDelegate.qml</file>
|
||||
<file alias="RoomList/SpaceListView.qml">qml/Page/RoomList/SpaceListView.qml</file>
|
||||
<file alias="RoomList/UserInfo.qml">qml/Page/RoomList/UserInfo.qml</file>
|
||||
|
||||
<file alias="LoadingPage.qml">qml/Page/LoadingPage.qml</file>
|
||||
|
||||
Reference in New Issue
Block a user