summary refs log tree commit diff
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-11-13 14:22:09 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2021-11-16 18:40:48 -0500
commit07aa89cca15f5c8bd031ee05e241795d61417c3f (patch)
treeffb449abdb4a5eadc2869a56d5c0f6adfbdc87cc
parentAdd highlight on hover (diff)
downloadnheko-07aa89cca15f5c8bd031ee05e241795d61417c3f.tar.xz
Port invite dialog to use ItemDelegate
-rw-r--r--resources/qml/dialogs/InviteDialog.qml62
1 files changed, 39 insertions, 23 deletions
diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml

index 86c176be..2d415a36 100644 --- a/resources/qml/dialogs/InviteDialog.qml +++ b/resources/qml/dialogs/InviteDialog.qml
@@ -98,37 +98,53 @@ ApplicationWindow { Layout.fillWidth: true Layout.fillHeight: true model: invitees + spacing: Nheko.paddingMedium - delegate: RowLayout { - spacing: Nheko.paddingMedium + delegate: ItemDelegate { + id: del - Avatar { - width: Nheko.avatarSize - height: Nheko.avatarSize - userid: model.mxid - url: model.avatarUrl.replace("mxc://", "image://MxcImage/") - displayName: model.displayName - onClicked: TimelineManager.openGlobalUserProfile(model.mxid) + hoverEnabled: true + width: ListView.view.width + height: layout.implicitHeight + onClicked: TimelineManager.openGlobalUserProfile(model.mxid) + background: Rectangle { + color: del.hovered ? Nheko.colors.dark : inviteDialogRoot.color } - ColumnLayout { - spacing: Nheko.paddingSmall + RowLayout { + id: layout - Label { - text: model.displayName - color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) - font.pointSize: fontMetrics.font.pointSize - } + spacing: Nheko.paddingMedium - Label { - text: model.mxid - color: Nheko.colors.buttonText - font.pointSize: fontMetrics.font.pointSize * 0.9 + Avatar { + width: Nheko.avatarSize + height: Nheko.avatarSize + userid: model.mxid + url: model.avatarUrl.replace("mxc://", "image://MxcImage/") + displayName: model.displayName + enabled: false } - Item { - Layout.fillHeight: true - Layout.fillWidth: true + ColumnLayout { + spacing: Nheko.paddingSmall + + Label { + text: model.displayName + color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) + font.pointSize: fontMetrics.font.pointSize + } + + Label { + text: model.mxid + color: Nheko.colors.buttonText + font.pointSize: fontMetrics.font.pointSize * 0.9 + } + + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } + } }