Use sections for power levels in the user list

Closes network/neochat#654
This commit is contained in:
James Graham
2024-08-22 19:34:31 +00:00
parent b3afa9f595
commit 80734944d3

View File

@@ -197,6 +197,14 @@ QQC2.ScrollView {
clip: true
focus: true
section.property: "powerLevelString"
section.delegate: Kirigami.ListSectionHeader {
required property string section
width: ListView.view.width
text: section
}
delegate: Delegates.RoundedItemDelegate {
id: userDelegate
@@ -230,7 +238,6 @@ QQC2.ScrollView {
Layout.fillHeight: true
}
QQC2.Label {
text: userDelegate.name
textFormat: Text.PlainText
@@ -238,14 +245,6 @@ QQC2.ScrollView {
Layout.fillWidth: true
}
QQC2.Label {
visible: userDelegate.powerLevel > 0
text: userDelegate.powerLevelString
color: Kirigami.Theme.disabledTextColor
textFormat: Text.PlainText
}
}
}
}