idek atp
This commit is contained in:
91
NotificationBox.qml
Normal file
91
NotificationBox.qml
Normal file
@@ -0,0 +1,91 @@
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
|
||||
Rectangle {
|
||||
id: notifRect
|
||||
required property var notification
|
||||
|
||||
property bool exiting: false
|
||||
width: parent?.width ?? 0
|
||||
height: notifContent.childrenRect.height + 32
|
||||
radius: 20
|
||||
color: "#181818"
|
||||
|
||||
Image {
|
||||
id: notifIcon
|
||||
visible: false
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 12
|
||||
}
|
||||
width: 40
|
||||
height: 40
|
||||
source: notification?.image ?? source
|
||||
layer.enabled: true
|
||||
}
|
||||
Rectangle {
|
||||
id: iconMask
|
||||
antialiasing: true
|
||||
layer.enabled: true
|
||||
visible: false
|
||||
anchors.fill: notifIcon
|
||||
layer.smooth: true
|
||||
radius: 8
|
||||
}
|
||||
MultiEffect {
|
||||
anchors.fill: notifIcon
|
||||
source: notifIcon
|
||||
maskEnabled: true
|
||||
maskSource: iconMask
|
||||
maskThresholdMin: 0.5
|
||||
maskSpreadAtMin: 1
|
||||
}
|
||||
Column {
|
||||
id: notifContent
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
topMargin: 16
|
||||
leftMargin: 16 + (notifIcon.source == "" ? 0 : 44)
|
||||
rightMargin: 16
|
||||
}
|
||||
spacing: 6
|
||||
Text {
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
color: "white"
|
||||
font.family: "Comfortaa"
|
||||
font.pixelSize: 16
|
||||
text: notification?.summary ?? text
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.Wrap
|
||||
maximumLineCount: 2
|
||||
}
|
||||
Text {
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
color: "white"
|
||||
font.family: "Comfortaa"
|
||||
font.pixelSize: 12
|
||||
text: notification?.body ?? text
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.Wrap
|
||||
maximumLineCount: 4
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
running: notification?.expireTimeout > 0
|
||||
interval: (notification?.expireTimeout > 0) ? notification?.expireTimeout : 0
|
||||
onTriggered: notification.tracked = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user