diff --git a/applets/notifications/package/contents/ui/NotificationItem.qml b/applets/notifications/package/contents/ui/NotificationItem.qml --- a/applets/notifications/package/contents/ui/NotificationItem.qml +++ b/applets/notifications/package/contents/ui/NotificationItem.qml @@ -19,7 +19,7 @@ */ import QtQuick 2.5 -import QtQuick.Layouts 1.1 +import QtQuick.Layouts 1.2 import QtQuick.Controls.Private 1.0 import org.kde.plasma.core 2.0 as PlasmaCore @@ -30,7 +30,7 @@ MouseArea { id: notificationItem width: parent.width - implicitHeight: Math.max(appIconItem.valid || imageItem.nativeWidth > 0 ? units.iconSizes.large : 0, mainLayout.height) + implicitHeight: Math.max(appIconItem.valid || imageItem.nativeWidth > 0 ? units.iconSizes.large : 0, mainLayout.height) // Add units.smallSpacing to correct for the topMargin of mainLayout according to number of lines // We need to clip here because we support displaying images through // and if we don't clip, they will be painted over the borders of the dialog/item @@ -68,7 +68,7 @@ } if (hasDefaultAction) { - // the notifications was clicked, trigger the default action if set + // the notification was clicked, trigger the default action if set action("default") } } @@ -151,6 +151,8 @@ anchors { top: parent.top left: parent.left + leftMargin: units.smallSpacing + topMargin: units.smallSpacing } visible: imageItem.nativeWidth == 0 && valid @@ -170,9 +172,11 @@ anchors { top: parent.top + topMargin: (bodyText.lineCount > 1) ? 0 : (units.smallSpacing * 0.5) // Lift up text if notification text is long left: appIconItem.valid || imageItem.nativeWidth > 0 ? appIconItem.right : parent.left right: parent.right - leftMargin: units.smallSpacing + leftMargin: units.smallSpacing * 2 + rightMargin: units.smallSpacing // Equal padding on either side (notification icon margin) } spacing: Math.round(units.smallSpacing / 2) @@ -211,7 +215,7 @@ width: units.iconSizes.smallMedium height: width visible: false - + iconSource: "configure" onClicked: { @@ -240,6 +244,7 @@ RowLayout { id: bottomPart Layout.alignment: Qt.AlignTop + Layout.bottomMargin: ((bodyText.lineCount > 1) ? 1 : ((bottomPart.height == 0) ? 0 : 1.5)) * units.smallSpacing spacing: units.smallSpacing // Force the whole thing to collapse if the children are invisible