Add header to UserMenu for mobile which has the user info

To give a little bit more context, and it also matches the message
context menu which does the same.
This commit is contained in:
Joshua Goins
2025-05-18 19:59:29 -04:00
parent d059195e92
commit 2687448212
3 changed files with 43 additions and 5 deletions

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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 {