mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Fix notification popup position in convergence mode
The input region Y was computed from the bottom of the screen instead of from the top, causing the touch region to be offset from the actual popup. Use openOffset directly since the popup anchors to the top. Unify the popup margin into a single property so the delegate x and the input-region regionX stay consistent.
This commit is contained in:
parent
aa4103f72a
commit
acecbcc86a
1 changed files with 6 additions and 3 deletions
|
|
@ -33,6 +33,9 @@ Window {
|
|||
readonly property real openOffset: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 3
|
||||
readonly property int longestLength: Math.max(Screen.width, Screen.height)
|
||||
readonly property bool isConvergence: ShellSettings.Settings.convergenceModeEnabled
|
||||
// Margin between popup and screen edge in convergence mode; used in both
|
||||
// the delegate x position and the input-region calculation so they stay in sync.
|
||||
readonly property real convergencePopupMargin: Kirigami.Units.gridUnit * 2
|
||||
property var keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone
|
||||
|
||||
LayerShell.Window.scope: "notification"
|
||||
|
|
@ -100,8 +103,8 @@ Window {
|
|||
}
|
||||
|
||||
if (isConvergence) {
|
||||
let regionX = notificationPopupManager.width - notificationPopupManager.popupWidth - Kirigami.Units.gridUnit * 4;
|
||||
let regionY = Screen.height - openOffset - popupHeight - Kirigami.Units.gridUnit;
|
||||
let regionX = notificationPopupManager.width - notificationPopupManager.popupWidth - notificationPopupManager.convergencePopupMargin;
|
||||
let regionY = openOffset;
|
||||
ShellUtil.setInputRegion(notificationPopupManager, Qt.rect(regionX, regionY, notificationPopupManager.popupWidth + Kirigami.Units.gridUnit * 2, popupHeight + Kirigami.Units.gridUnit * 2));
|
||||
} else {
|
||||
ShellUtil.setInputRegion(notificationPopupManager, Qt.rect((notificationPopupManager.width - notificationPopupManager.popupWidth - Kirigami.Units.gridUnit) / 2, openOffset - Kirigami.Units.gridUnit / 2, notificationPopupManager.popupWidth + Kirigami.Units.gridUnit, popupHeight + Kirigami.Units.gridUnit * ((notifications.count - notifications.currentPopupIndex > 1) ? 4 : 1)));
|
||||
|
|
@ -203,7 +206,7 @@ Window {
|
|||
id: popup
|
||||
|
||||
x: notificationPopupManager.isConvergence
|
||||
? (parent.width - width - Kirigami.Units.gridUnit * 2)
|
||||
? (parent.width - width - notificationPopupManager.convergencePopupMargin)
|
||||
: (parent.width - width) / 2
|
||||
z: notifications.count - index
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue