// SPDX-FileCopyrightText: 2025 Joshua Goins // SPDX-FileCopyrightText: 2026 Matvey Shcherbinin // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL import QtQuick import QtQuick.Controls as QQC2 import QtQuick.Layouts import org.kde.kirigami as Kirigami import org.kde.kirigamiaddons.components as Components import koutnet.app // The panel behind a face or a name in the timeline, after NeoChat's // UserMenu.qml: the identity in the header, then the two things you can do // with it. The actions are reported out rather than acted on here, because // opening a profile and writing a mention belong to the window. Components.ConvergentContextMenu { id: root required property string userId required property string displayName required property string avatarSource signal profileRequested(string userId) signal mentionRequested(string name, string userId) headerContentItem: RowLayout { id: detailRow spacing: Kirigami.Units.largeSpacing Components.Avatar { Layout.preferredWidth: Kirigami.Units.iconSizes.medium Layout.preferredHeight: Kirigami.Units.iconSizes.medium name: root.displayName source: root.avatarSource } ColumnLayout { Layout.fillWidth: true spacing: 0 Kirigami.Heading { level: 1 Layout.fillWidth: true font.bold: true elide: Text.ElideRight wrapMode: Text.NoWrap text: root.displayName textFormat: Text.PlainText } QQC2.Label { id: idLabel textFormat: TextEdit.PlainText text: root.userId elide: Qt.ElideRight } } } QQC2.Action { text: i18nc("@action:button", "Open Profile") icon.name: "im-user-symbolic" onTriggered: root.profileRequested(root.userId) } QQC2.Action { text: i18nc("@action:button", "Mention") icon.name: "username-copy-symbolic" onTriggered: root.mentionRequested(root.displayName, root.userId) } }