Move back to abstrastlistitem for room list
This commit is contained in:
@@ -91,11 +91,11 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Kirigami.SwipeListItem {
|
||||
delegate: Kirigami.AbstractListItem {
|
||||
id: roomListItem
|
||||
property bool itemVisible: model.categoryVisible || sortFilterRoomListModel.filterText.length > 0 || Config.mergeRoomList
|
||||
visible: itemVisible
|
||||
height: itemVisible ? implicitHeight : 0
|
||||
height: itemVisible ? roomLayout.implicitHeight : 0
|
||||
highlighted: roomManager.currentRoom && roomManager.currentRoom.name === name
|
||||
focus: true
|
||||
action: Kirigami.Action {
|
||||
@@ -110,28 +110,14 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
}
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
id: optionAction
|
||||
|
||||
text: i18n("Configure room")
|
||||
|
||||
icon.name: "configure"
|
||||
onTriggered: roomListContextMenu.createObject(roomLayout, {"room": currentRoom}).popup();
|
||||
}
|
||||
]
|
||||
contentItem: Item {
|
||||
id: listItem
|
||||
focus: true
|
||||
implicitHeight: roomLayout.implicitHeight
|
||||
RowLayout {
|
||||
contentItem: RowLayout {
|
||||
id: roomLayout
|
||||
anchors.fill: parent
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
Kirigami.Avatar {
|
||||
id: roomAvatar
|
||||
property int size: Kirigami.Units.gridUnit * 3 - Kirigami.Units.smallSpacing * 2;
|
||||
property int size: parent.height - Kirigami.Units.smallSpacing * 2;
|
||||
Layout.minimumHeight: size
|
||||
Layout.maximumHeight: size
|
||||
Layout.minimumWidth: size
|
||||
@@ -142,6 +128,7 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: roomitemcolumn
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
@@ -164,7 +151,7 @@ Kirigami.ScrollablePage {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
text: (lastEvent == "" ? topic : lastEvent).replace(/(\r\n\t|\n|\r\t)/gm," ")
|
||||
visible: text.length > 0
|
||||
visible: text.length >
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
@@ -182,18 +169,13 @@ Kirigami.ScrollablePage {
|
||||
radius: height / 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (mouse.button == Qt.RightButton) {
|
||||
roomListContextMenu.createObject(roomLayout, {"room": currentRoom}).popup()
|
||||
} else {
|
||||
enterRoomAction.trigger();
|
||||
listView.currentIndex = index;
|
||||
}
|
||||
QQC2.Button {
|
||||
visible: roomListItem.hovered || Kirigami.Settings.isMobile
|
||||
Accessible.description: i18n("Configure room")
|
||||
action: Kirigami.Action {
|
||||
id: optionAction
|
||||
icon.name: "configure"
|
||||
onTriggered: roomListContextMenu.createObject(roomLayout, {"room": currentRoom}).popup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user