Compare commits

...

2 Commits

Author SHA1 Message Date
James Graham
90829e4959 Refactor based on better implementation 2024-05-28 19:15:54 +01:00
James Graham
6a1ff37011 Use standard ItemDelegates rather than the kirigami-addons special ones 2024-05-27 18:41:53 +01:00
2 changed files with 10 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ import org.kde.kitemmodels
import org.kde.neochat
Delegates.RoundedItemDelegate {
QQC2.ItemDelegate {
id: root
required property int index
@@ -45,6 +45,14 @@ Delegates.RoundedItemDelegate {
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()

View File

@@ -131,6 +131,7 @@ Kirigami.Page {
id: treeView
topMargin: Math.round(Kirigami.Units.smallSpacing / 2)
alternatingRows: false
clip: true
reuseItems: false