Files
home/.local/share/plasma/plasmoids/KdeControlStation/contents/ui/components/DndButton.qml
2025-10-08 10:35:48 +02:00

35 lines
950 B
QML

import QtQml 2.15
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "../lib" as Lib
import "../js/funcs.js" as Funcs
import org.kde.notificationmanager as NotificationManager
import org.kde.kirigami as Kirigami
Lib.CardButton {
visible: root.showDnd
Layout.fillWidth: true
Layout.fillHeight: true
title: i18n("Do Not Disturb")
// NOTIFICATION MANAGER
property var notificationSettings: notificationSettings
NotificationManager.Settings {
id: notificationSettings
}
// Enables "Do Not Disturb" on click
onClicked: {
Funcs.toggleDnd();
}
Lib.Icon {
id: dndIcon
anchors.fill: parent
customIcon: true
source: {
return (Funcs.checkInhibition() ? Qt.resolvedUrl("../icons/feather/notifications-off.svg") : Qt.resolvedUrl("../icons/feather/notifications-on.svg"));
}
selected: Funcs.checkInhibition()
}
}