Commit 0e40a1ca authored by Nate Graham's avatar Nate Graham 🔩

[applets/notifications] Widen pop-up and reduce spacing when on top or bottom center

Summary:
Somehow the notification pop-up's positioning has never felt quite right to me. When it's
in a bottom corner, it blocks the view of the latest messages in chat apps, or the text
I'm searching for in Kate. When it's in a top corner, it blocks part of the open app's
toolbar or tab bar that I often use. The best place I've found for is in the top-middle,
which doesn't block very many of the thing I'm active using, and its centered position
feels aesthetically pleasing. I've been using this for a bit and quite like it.

However there is ony deficiency: the pop-up is not very wide, so it becomes quite tall
when displaying multi-line messages from chat apps in particular, which makes the
notification stack intrude into the middle of the screen where it definitely blocks things
you want to be looking at. This is annoying.

This patch resolves that issue by making the pop-up's size wider and the spacing between
pop-ups smaller when the pop-ups are positioned in the top or bottom middle.

Test Plan:
Centered pop-ups now look like this:
Single pop-up: {F8247020}
Stack of pop-ups: {F8247025}

There is no visual change for pop-ups in the corner, where they are by default.

Reviewers: #vdg, #plasma, broulik, ndavis, cblack, bshah

Reviewed By: #vdg, #plasma, broulik, ndavis, cblack, bshah

Subscribers: bshah, IlyaBizyaev, ndavis, cblack, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28989
parent c56e12cc
......@@ -139,9 +139,13 @@ QtObject {
onFocusDialogChanged: positionPopups()
// The raw width of the popup's content item, the Dialog itself adds some margins
property int popupWidth: units.gridUnit * 18
// Make it wider when on the top or the bottom center, since there's more horizontal
// space available without looking weird
property int popupWidth: popupLocation & Qt.AlignHCenter ? units.gridUnit * 28 : units.gridUnit * 18
property int popupEdgeDistance: units.largeSpacing * 2
property int popupSpacing: units.largeSpacing
// Reduce spacing between popups when centered so the stack doesn't intrude into the
// view as much
property int popupSpacing: popupLocation & Qt.AlignHCenter ? units.smallSpacing : units.largeSpacing
// How much vertical screen real estate the notification popups may consume
readonly property real popupMaximumScreenFill: 0.75
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment