Changeset View
Changeset View
Standalone View
Standalone View
src/contents/ui/EventReadIndicator.qml
| Show All 17 Lines | ItemDelegate { | ||||
| property var shouldShow: true | property var shouldShow: true | ||||
| property var model | property var model | ||||
| property var maxItems: 4 | property var maxItems: 4 | ||||
| property var avatarSize: Kirigami.Units.iconSizes.sizeForLabels || Kirigami.Units.iconSizes.small / 2 | property var avatarSize: Kirigami.Units.iconSizes.sizeForLabels || Kirigami.Units.iconSizes.small / 2 | ||||
| property var actualItems: Math.min(model.count, maxItems) | property var actualItems: Math.min(model.count, maxItems) | ||||
| visible: shouldShow && readIndicator.model.count > 0 | visible: shouldShow && readIndicator.model.count > 0 | ||||
| implicitHeight: layout.implicitHeight | contentItem: RowLayout { | ||||
| implicitWidth: layout.implicitWidth | |||||
| RowLayout { | |||||
| id: layout | id: layout | ||||
| objectName: 'readIndicatorLayout' | objectName: 'readIndicatorLayout' | ||||
| anchors.fill: parent | |||||
| Repeater { | Repeater { | ||||
| model: readIndicator.actualItems | model: readIndicator.actualItems | ||||
| Kazv.AvatarAdapter { | Kazv.AvatarAdapter { | ||||
| objectName: `readIndicatorAvatar${index}` | objectName: `readIndicatorAvatar${index}` | ||||
| property var member: readIndicator.model.at(index) | property var member: readIndicator.model.at(index) | ||||
| property var nameProvider: Kazv.UserNameProvider { | property var nameProvider: Kazv.UserNameProvider { | ||||
| user: member | user: member | ||||
| Show All 26 Lines | contentItem: ColumnLayout { | ||||
| text: l10n.get('event-read-indicator-list-title', { numUsers: readIndicator.model.count }) | text: l10n.get('event-read-indicator-list-title', { numUsers: readIndicator.model.count }) | ||||
| } | } | ||||
| Repeater { | Repeater { | ||||
| model: readIndicator.model | model: readIndicator.model | ||||
| ItemDelegate { | ItemDelegate { | ||||
| Layout.fillWidth: true | Layout.fillWidth: true | ||||
| implicitWidth: itemLayout.implicitWidth | |||||
| implicitHeight: itemLayout.implicitHeight | |||||
| property var member: readIndicator.model.at(index) | property var member: readIndicator.model.at(index) | ||||
| property var nameProvider: Kazv.UserNameProvider { | property var nameProvider: Kazv.UserNameProvider { | ||||
| user: member | user: member | ||||
| } | } | ||||
| onPressed: { | onPressed: { | ||||
| activateUserPage(member, room); | activateUserPage(member, room); | ||||
| readIndicatorDrawer.close(); | readIndicatorDrawer.close(); | ||||
| } | } | ||||
| RowLayout { | contentItem: RowLayout { | ||||
| id: itemLayout | id: itemLayout | ||||
| anchors.fill: parent | |||||
| Kazv.AvatarAdapter { | Kazv.AvatarAdapter { | ||||
| objectName: `readIndicatorAvatar${index}` | objectName: `readIndicatorAvatar${index}` | ||||
| Layout.preferredWidth: readIndicator.avatarSize | Layout.preferredWidth: readIndicator.avatarSize | ||||
| Layout.preferredHeight: readIndicator.avatarSize | Layout.preferredHeight: readIndicator.avatarSize | ||||
| source: member.avatarMxcUri ? matrixSdk.mxcUriToHttp(member.avatarMxcUri) : '' | source: member.avatarMxcUri ? matrixSdk.mxcUriToHttp(member.avatarMxcUri) : '' | ||||
| name: nameProvider.name | name: nameProvider.name | ||||
| } | } | ||||
| Show All 17 Lines | |||||