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