summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2016-12-05 11:40:55 +0100
committerKai Uwe Broulik <[email protected]>2016-12-05 11:40:55 +0100
commit6c7a2a65c1b7953d322d1d4740c0ed4329257380 (patch)
tree76c3167301ec80993cd6adc1859dd9d7204fffa6
parent76baa59dea733b19208729b8a43b3375fa1d5e2e (diff)
[Notifications] Tighten layout
Our notification popups are huge compared to other platforms, this tightens and streamlines the layout a bit. The button sizes are much more dynamic now, allowing them to become smaller but also significantly wider. It always bothered me how, at least in German locale, most of the action buttons are elided. Differential Revision: https://phabricator.kde.org/D3560
-rw-r--r--applets/notifications/package/contents/ui/NotificationItem.qml18
-rw-r--r--applets/notifications/package/contents/ui/NotificationPopup.qml7
2 files changed, 11 insertions, 14 deletions
diff --git a/applets/notifications/package/contents/ui/NotificationItem.qml b/applets/notifications/package/contents/ui/NotificationItem.qml
index cadb26e..3827b94 100644
--- a/applets/notifications/package/contents/ui/NotificationItem.qml
+++ b/applets/notifications/package/contents/ui/NotificationItem.qml
@@ -150,15 +150,14 @@ Item {
top: parent.top
left: appIconItem.visible || imageItem.visible ? appIconItem.right : parent.left
right: parent.right
- leftMargin: units.smallSpacing * 2
+ leftMargin: units.smallSpacing
}
- spacing: units.smallSpacing
+ spacing: Math.round(units.smallSpacing / 2)
RowLayout {
id: titleBar
spacing: units.smallSpacing
- height: units.iconSizes.smallMedium
PlasmaExtras.Heading {
id: summaryLabel
@@ -211,6 +210,7 @@ Item {
RowLayout {
id: bottomPart
Layout.alignment: Qt.AlignTop
+ spacing: units.smallSpacing
// Force the whole thing to collapse if the children are invisible
// If there is a big notification followed by a small one, the height
@@ -224,11 +224,6 @@ Item {
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
- anchors {
- leftMargin: units.smallSpacing * 2
- rightMargin: units.smallSpacing * 2
- }
-
implicitHeight: maximumTextHeight > 0 ? Math.min(maximumTextHeight, bodyText.paintedHeight) : bodyText.paintedHeight
acceptedButtons: Qt.RightButton
@@ -301,7 +296,10 @@ Item {
ColumnLayout {
id: actionsColumn
Layout.alignment: Qt.AlignTop
- Layout.maximumWidth: theme.mSize(theme.defaultFont).width * (compact ? 8 : 12)
+ Layout.maximumWidth: theme.mSize(theme.defaultFont).width * (compact ? 10 : 16)
+ // this is so it never collapses but always follows what the Buttons below want
+ // but also don't let the buttons get too narrow (e.g. "View" or "Open" button)
+ Layout.minimumWidth: Math.max(units.gridUnit * 4, implicitWidth)
spacing: units.smallSpacing
visible: notificationItem.actions && notificationItem.actions.count > 0
@@ -311,6 +309,8 @@ Item {
model: notificationItem.actions
PlasmaComponents.Button {
+ Layout.fillWidth: true
+ Layout.preferredWidth: minimumWidth
Layout.maximumWidth: actionsColumn.Layout.maximumWidth
text: model.text
onClicked: notificationItem.action(model.id)
diff --git a/applets/notifications/package/contents/ui/NotificationPopup.qml b/applets/notifications/package/contents/ui/NotificationPopup.qml
index 2f0a065..15a0d2f 100644
--- a/applets/notifications/package/contents/ui/NotificationPopup.qml
+++ b/applets/notifications/package/contents/ui/NotificationPopup.qml
@@ -77,8 +77,8 @@ PlasmaCore.Dialog {
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
- width: notificationItem.width + 2 * notificationItem.x
- height: notificationItem.implicitHeight + 2 * notificationItem.y
+ width: notificationItem.width
+ height: notificationItem.implicitHeight
hoverEnabled: true
@@ -121,9 +121,6 @@ PlasmaCore.Dialog {
configurable: notificationProperties.configurable && !Settings.isMobile ? true : false
urls: notificationProperties.urls || []
- x: units.smallSpacing
- y: units.smallSpacing
-
width: Math.round(23 * units.gridUnit)
maximumTextHeight: theme.mSize(theme.defaultFont).height * 10