summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrešimir Čohar <[email protected]>2019-01-11 08:37:41 -0700
committerNate Graham <[email protected]>2019-01-11 09:24:12 -0700
commit6a625cd61d2975682684ac559e358639600d042d (patch)
treeb0fabadacb2494489d3b561bd66d2fc63fc7ac4d
parentcc8d3e7751859b703e09984d149268e0564a0124 (diff)
[Notifications] Add padding to notifications
Summary: This patch aims to add padding to the notification widget and fully remedy the issues that arise once it is applied. Test Plan: Before: {F6533139} After: {F6533140} (More padding, and margins as even as can be) Reviewers: #vdg, #plasma, ngraham, davidedmundson Reviewed By: #vdg, #plasma, ngraham, davidedmundson Subscribers: broulik, Codezela, abetts, filipf, davidedmundson, hein, ndavis, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D17975
-rw-r--r--applets/notifications/package/contents/ui/NotificationItem.qml12
1 files changed, 8 insertions, 4 deletions
diff --git a/applets/notifications/package/contents/ui/NotificationItem.qml b/applets/notifications/package/contents/ui/NotificationItem.qml
index f68b293..e7b748a 100644
--- a/applets/notifications/package/contents/ui/NotificationItem.qml
+++ b/applets/notifications/package/contents/ui/NotificationItem.qml
@@ -30,7 +30,7 @@ import org.kde.kquickcontrolsaddons 2.0
MouseArea {
id: notificationItem
width: parent.width
- implicitHeight: Math.max(appIconItem.valid || imageItem.nativeWidth > 0 ? units.iconSizes.large : 0, mainLayout.height)
+ implicitHeight: bodyText.lineCount > 1 ? mainLayout.height : (appIconItem.valid || imageItem.nativeWidth > 0 ? (Math.max((mainLayout.height + 2 * units.smallSpacing),(units.iconSizes.large + 2 * units.smallSpacing))) : (bottomPart.height != 0 ? (mainLayout.height + 2 * units.smallSpacing) : (mainLayout.height + units.smallSpacing)))
// We need to clip here because we support displaying images through <img/>
// and if we don't clip, they will be painted over the borders of the dialog/item
@@ -68,7 +68,7 @@ MouseArea {
}
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 @@ MouseArea {
anchors {
top: parent.top
left: parent.left
+ leftMargin: units.smallSpacing
+ topMargin: units.smallSpacing
}
visible: imageItem.nativeWidth == 0 && valid
@@ -170,9 +172,11 @@ MouseArea {
anchors {
top: parent.top
+ topMargin: bodyText.lineCount > 1 ? 0 : units.smallSpacing // Lift up heading if bodyText 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 @@ MouseArea {
width: units.iconSizes.smallMedium
height: width
visible: false
-
+
iconSource: "configure"
onClicked: {