working notifications
This commit is contained in:
parent
cf4696fe04
commit
e1504bfc92
5 changed files with 112 additions and 0 deletions
44
modules/notifications/NotiCard.qml
Normal file
44
modules/notifications/NotiCard.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick.Layouts
|
||||
import QtQuick
|
||||
import qs
|
||||
import qs.settings
|
||||
import qs.widgets
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
required property var notification
|
||||
implicitWidth: 300
|
||||
implicitHeight: 100
|
||||
radius: Config.rounding
|
||||
anchors.right: parent?.right
|
||||
color: Colors.base01
|
||||
child: WrapperMouseArea {
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
IconImage {
|
||||
id: appIcon
|
||||
Layout.leftMargin: 16
|
||||
source: root.notification.image ? root.notification.image : ''
|
||||
implicitSize: 48
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
StyledText {
|
||||
id: title
|
||||
text: root.notification?.summary == null ? '' : root.notification.summary
|
||||
}
|
||||
StyledText {
|
||||
id: body
|
||||
text: root.notification.body ? root.notification.body : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
root.notification.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue