fix notification styling
This commit is contained in:
parent
0d20fc7313
commit
4d59c72ab6
2 changed files with 29 additions and 13 deletions
|
|
@ -11,11 +11,18 @@ WrapperRectangle {
|
||||||
required property var notification
|
required property var notification
|
||||||
required property ShellScreen nScreen
|
required property ShellScreen nScreen
|
||||||
implicitWidth: nScreen.width / 6
|
implicitWidth: nScreen.width / 6
|
||||||
implicitHeight: 80
|
implicitHeight: 100
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
anchors.right: parent?.right
|
anchors.right: parent?.right
|
||||||
color: Colors.base01
|
color: Colors.base01
|
||||||
clip: true
|
clip: true
|
||||||
|
Timer {
|
||||||
|
id: dismissTimer
|
||||||
|
running: true
|
||||||
|
interval: 5000
|
||||||
|
repeat: false
|
||||||
|
onTriggered: root.notification.dismiss()
|
||||||
|
}
|
||||||
child: WrapperMouseArea {
|
child: WrapperMouseArea {
|
||||||
id: mouseHandler
|
id: mouseHandler
|
||||||
child: RowLayout {
|
child: RowLayout {
|
||||||
|
|
@ -34,6 +41,7 @@ WrapperRectangle {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.leftMargin: appIcon.visible ? 0 : 16
|
Layout.leftMargin: appIcon.visible ? 0 : 16
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
text: "\ue7f4"
|
text: "\ue7f4"
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
|
|
@ -44,14 +52,20 @@ WrapperRectangle {
|
||||||
opacity: 0.4
|
opacity: 0.4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 0
|
||||||
StyledText {
|
StyledText {
|
||||||
id: title
|
id: title
|
||||||
|
Layout.bottomMargin: 0
|
||||||
|
Layout.topMargin: 5
|
||||||
|
Layout.alignment: Qt.AlignBottom
|
||||||
|
Layout.fillWidth: true
|
||||||
text: root.notification?.summary == null ? '' : root.notification.summary
|
text: root.notification?.summary == null ? '' : root.notification.summary
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
StyledText {
|
StyledText {
|
||||||
id: body
|
id: body
|
||||||
|
Layout.alignment: Qt.AlignBottom
|
||||||
text: root.notification?.body ? root.notification.body : ''
|
text: root.notification?.body ? root.notification.body : ''
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -59,6 +73,7 @@ WrapperRectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ Singleton {
|
||||||
id: server
|
id: server
|
||||||
imageSupported: true
|
imageSupported: true
|
||||||
bodyImagesSupported: true
|
bodyImagesSupported: true
|
||||||
|
|
||||||
onNotification: notification => {
|
onNotification: notification => {
|
||||||
notification.tracked = true;
|
notification.tracked = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue