diff --git a/src/app/qml/UserMenu.qml b/src/app/qml/UserMenu.qml index 3986c821a..1c2859f40 100644 --- a/src/app/qml/UserMenu.qml +++ b/src/app/qml/UserMenu.qml @@ -15,10 +15,49 @@ import org.kde.neochat.devtools KirigamiComponents.ConvergentContextMenu { id: root - required property NeoChatConnection connection required property Kirigami.ApplicationWindow window required property var author + headerContentItem: RowLayout { + id: detailRow + + spacing: Kirigami.Units.largeSpacing + + KirigamiComponents.Avatar { + id: avatar + Layout.preferredWidth: Kirigami.Units.iconSizes.medium + Layout.preferredHeight: Kirigami.Units.iconSizes.medium + + name: root.author.displayName + source: root.author.avatarUrl + color: root.author.color + } + + ColumnLayout { + Layout.fillWidth: true + + spacing: 0 + + Kirigami.Heading { + level: 1 + Layout.fillWidth: true + font.bold: true + + elide: Text.ElideRight + wrapMode: Text.NoWrap + text: root.author.displayName + textFormat: Text.PlainText + } + + QQC2.Label { + id: idLabel + textFormat: TextEdit.PlainText + text: root.author.id + elide: Qt.ElideRight + } + } + } + QQC2.Action { text: i18nc("@action:button", "Open Profile") icon.name: "im-user-symbolic" diff --git a/src/timeline/AuthorComponent.qml b/src/timeline/AuthorComponent.qml index 7f2a4aacc..8d2e45e26 100644 --- a/src/timeline/AuthorComponent.qml +++ b/src/timeline/AuthorComponent.qml @@ -52,11 +52,10 @@ RowLayout { function openUserMenu(): void { const menu = Qt.createComponent("org.kde.neochat", "UserMenu").createObject(root, { - connection: root.connection, window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow, author: root.author, }); - menu.popup(root); + menu.popup(root.QQC2.Overlay.overlay); } HoverHandler { diff --git a/src/timeline/MessageDelegate.qml b/src/timeline/MessageDelegate.qml index cf3e1927c..a2c8cba3b 100644 --- a/src/timeline/MessageDelegate.qml +++ b/src/timeline/MessageDelegate.qml @@ -173,11 +173,11 @@ MessageDelegateBase { function openUserMenu(): void { const menu = Qt.createComponent("org.kde.neochat", "UserMenu").createObject(root, { - connection: root.connection, window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow, author: root.author, }); - menu.popup(root); + console.info(Qt.createComponent("org.kde.neochat", "UserMenu").errorString()); + menu.popup(root.QQC2.Overlay.overlay); } HoverHandler {