2021-12-22 23:29:00 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
|
|
|
|
* SPDX-FileCopyrightText: 2018-2019 Kai Uwe Broulik <kde@privat.broulik.de>
|
2024-07-27 02:29:38 +00:00
|
|
|
*
|
2021-12-22 23:29:00 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2022-02-12 05:19:44 +00:00
|
|
|
*/
|
2021-12-22 23:29:00 +00:00
|
|
|
|
|
|
|
|
import QtQuick 2.8
|
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
|
import QtQuick.Window 2.2
|
|
|
|
|
|
|
|
|
|
import org.kde.kirigami 2.12 as Kirigami
|
|
|
|
|
|
2023-09-05 15:34:49 +00:00
|
|
|
import org.kde.plasma.core as PlasmaCore
|
2023-03-08 13:26:36 +00:00
|
|
|
import org.kde.plasma.plasma5support 2.0 as P5Support
|
2021-12-22 23:29:00 +00:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
2023-09-27 04:08:49 +00:00
|
|
|
import org.kde.notificationmanager as NotificationManager
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2023-05-07 12:47:22 +00:00
|
|
|
import org.kde.coreaddons 1.0 as KCoreAddons
|
2021-12-22 23:29:00 +00:00
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
id: notificationHeading
|
|
|
|
|
|
2025-06-23 00:16:16 +00:00
|
|
|
property bool inLockScreen: false
|
2021-12-22 23:29:00 +00:00
|
|
|
property var applicationIconSource
|
|
|
|
|
property string applicationName
|
|
|
|
|
property string originName
|
|
|
|
|
|
2023-07-25 01:13:52 +00:00
|
|
|
spacing: Kirigami.Units.smallSpacing
|
|
|
|
|
Layout.preferredHeight: Math.max(applicationNameLabel.implicitHeight, Kirigami.Units.iconSizes.small)
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2023-08-18 09:08:07 +00:00
|
|
|
Kirigami.Icon {
|
2021-12-22 23:29:00 +00:00
|
|
|
id: applicationIconItem
|
2023-07-25 01:13:52 +00:00
|
|
|
Layout.topMargin: Kirigami.Units.smallSpacing
|
|
|
|
|
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
|
|
|
|
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
|
|
|
|
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
2021-12-22 23:29:00 +00:00
|
|
|
source: notificationHeading.applicationIconSource
|
|
|
|
|
visible: valid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlasmaComponents.Label {
|
|
|
|
|
id: applicationNameLabel
|
2023-07-25 01:13:52 +00:00
|
|
|
Layout.leftMargin: Kirigami.Units.smallSpacing
|
2021-12-22 23:29:00 +00:00
|
|
|
Layout.fillWidth: true
|
2024-08-01 01:18:33 +00:00
|
|
|
|
2025-06-23 00:16:16 +00:00
|
|
|
color: inLockScreen ? "white" : Kirigami.Theme.textColor
|
2024-08-01 01:18:33 +00:00
|
|
|
|
|
|
|
|
opacity: 0.75
|
2021-12-22 23:29:00 +00:00
|
|
|
elide: Text.ElideLeft
|
2023-05-13 15:15:52 +00:00
|
|
|
font.bold: true
|
2021-12-22 23:29:00 +00:00
|
|
|
text: notificationHeading.applicationName + (notificationHeading.originName ? " · " + notificationHeading.originName : "")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: spacer
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
}
|
|
|
|
|
}
|