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:
@@ -15,10 +15,49 @@ import org.kde.neochat.devtools
|
|||||||
KirigamiComponents.ConvergentContextMenu {
|
KirigamiComponents.ConvergentContextMenu {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property NeoChatConnection connection
|
|
||||||
required property Kirigami.ApplicationWindow window
|
required property Kirigami.ApplicationWindow window
|
||||||
required property var author
|
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 {
|
QQC2.Action {
|
||||||
text: i18nc("@action:button", "Open Profile")
|
text: i18nc("@action:button", "Open Profile")
|
||||||
icon.name: "im-user-symbolic"
|
icon.name: "im-user-symbolic"
|
||||||
|
|||||||
@@ -52,11 +52,10 @@ RowLayout {
|
|||||||
|
|
||||||
function openUserMenu(): void {
|
function openUserMenu(): void {
|
||||||
const menu = Qt.createComponent("org.kde.neochat", "UserMenu").createObject(root, {
|
const menu = Qt.createComponent("org.kde.neochat", "UserMenu").createObject(root, {
|
||||||
connection: root.connection,
|
|
||||||
window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow,
|
window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow,
|
||||||
author: root.author,
|
author: root.author,
|
||||||
});
|
});
|
||||||
menu.popup(root);
|
menu.popup(root.QQC2.Overlay.overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
|
|||||||
@@ -173,11 +173,11 @@ MessageDelegateBase {
|
|||||||
|
|
||||||
function openUserMenu(): void {
|
function openUserMenu(): void {
|
||||||
const menu = Qt.createComponent("org.kde.neochat", "UserMenu").createObject(root, {
|
const menu = Qt.createComponent("org.kde.neochat", "UserMenu").createObject(root, {
|
||||||
connection: root.connection,
|
|
||||||
window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow,
|
window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow,
|
||||||
author: root.author,
|
author: root.author,
|
||||||
});
|
});
|
||||||
menu.popup(root);
|
console.info(Qt.createComponent("org.kde.neochat", "UserMenu").errorString());
|
||||||
|
menu.popup(root.QQC2.Overlay.overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
|
|||||||
Reference in New Issue
Block a user