// SPDX-FileCopyrightText: 2026 Matvey Shcherbinin // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL import QtQuick import QtQuick.Layouts import QtQuick.Controls as QQC2 import org.kde.kirigami as Kirigami import org.kde.kirigamiaddons.components as Components import koutnet.app // It used to be a frameless always-on-top Window that slid up from Screen.height, // was dragged by a MouseArea, and drew accept and reject as circles holding a Label // with an icon.name Label has no such property for - so both were blank. A // PromptDialog follows the window rather than the screen. Kirigami.PromptDialog { id: root property string callerName: "" property string callerSource: "" // For a Matrix room call: the media address named in the invitation, the // exact host accepting will dial. Shown because the offer is written by a // room member, so consent must cover the connection, not just the call. property string mediaAddress: "" signal answered() signal declined() // See Main.qml: a dialog is reparented into the overlay, its own theme chain. Kirigami.Theme.inherit: false title: i18nc("@title:window", "Incoming call") showCloseButton: false // the standard set would put an OK next to them and hide which one picks up. standardButtons: QQC2.Dialog.NoButton customFooterActions: [ Kirigami.Action { text: i18nc("@action:button pick up the incoming call", "Answer") icon.name: "call-start" onTriggered: { root.answered() root.close() } }, Kirigami.Action { text: i18nc("@action:button refuse the incoming call", "Decline") icon.name: "call-stop" onTriggered: { root.declined() root.close() } } ] function callRejected() { root.close() } RowLayout { spacing: Kirigami.Units.largeSpacing Components.Avatar { implicitWidth: Kirigami.Units.gridUnit * 4 implicitHeight: Kirigami.Units.gridUnit * 4 Layout.alignment: Qt.AlignVCenter name: root.callerName } ColumnLayout { Layout.fillWidth: true spacing: 0 Kirigami.Heading { Layout.fillWidth: true level: 2 elide: Text.ElideRight text: root.callerName } QQC2.Label { Layout.fillWidth: true elide: Text.ElideRight text: root.callerSource font: Kirigami.Theme.smallFont color: AppPalette.disabledText } QQC2.Label { visible: root.mediaAddress.length > 0 Layout.fillWidth: true wrapMode: Text.WordWrap // the font group takes one assignment: "font: ..." plus // "font.bold" on top is a duplicate, and a dialog that fails to // parse takes the whole window down with it text: i18nc("@info a room call opens a direct connection to the shown host address", "Answering opens a connection to %1", root.mediaAddress) font: Kirigami.Theme.smallFont } } } }