From 90829e4959d9da52258dd38f501f47d44591232f Mon Sep 17 00:00:00 2001 From: James Graham Date: Tue, 28 May 2024 19:14:30 +0100 Subject: [PATCH] Refactor based on better implementation --- src/qml/RoomDelegate.qml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/qml/RoomDelegate.qml b/src/qml/RoomDelegate.qml index eeb05f2ec..5e467059b 100644 --- a/src/qml/RoomDelegate.qml +++ b/src/qml/RoomDelegate.qml @@ -10,7 +10,6 @@ import org.kde.kirigami as Kirigami import org.kde.kirigamiaddons.delegates as Delegates import org.kde.kirigamiaddons.labs.components as Components import org.kde.kitemmodels -import org.kde.desktop.private as Private import org.kde.neochat @@ -46,6 +45,14 @@ QQC2.ItemDelegate { Keys.onEnterPressed: clicked() Keys.onReturnPressed: clicked() + leftInset: horizontalPadding / 2 + rightInset: horizontalPadding / 2 + // We want total spacing between consecutive list items to be + // verticalPadding. So use half that as top/bottom margin, separately + // ceiling/flooring them so that the total spacing is preserved. + topInset: Math.ceil(verticalPadding / 2) + bottomInset: Math.ceil(verticalPadding / 2) + TapHandler { acceptedButtons: Qt.RightButton onTapped: (eventPoint, button) => root.createRoomListContextMenu() @@ -146,11 +153,6 @@ QQC2.ItemDelegate { } } - background: Private.DefaultListItemBackground { - control: root - styling: Private.DefaultListItemBackground.Styling.List - } - function createRoomListContextMenu() { const component = Qt.createComponent('org.kde.neochat', 'ContextMenu'); if (component.status === Component.Error) {