effects/desktopgrid: Fix grid's size and scale w.r.t. row/column spacing

This patch makes grid actually account for the spacing, so that when
fully shown it won't cut off bottom or right edge of desktops. It can
be easily seen with a wallpaper that has visible features on the edges
such as borders, or by settings rowSpacing & columnSpacing to an
absurdly high value.
This commit is contained in:
ivan tkachenko 2022-08-04 13:54:36 +03:00
parent 5af891ec8e
commit fc757be20a
No known key found for this signature in database
GPG key ID: AF72731B7C654CB3

View file

@ -154,7 +154,7 @@ Rectangle {
id: grid
property Item currentItem
readonly property real targetScale: 1 / Math.max(rows, columns)
readonly property real targetScale: Math.min(parent.width / width, parent.height / height)
property real panelOpacity: 1
Behavior on x {
@ -186,8 +186,8 @@ Rectangle {
}
}
width: parent.width * columns
height: parent.height * rows
width: (parent.width + columnSpacing) * columns - columnSpacing
height: (parent.height + rowSpacing) * rows - rowSpacing
rowSpacing: PlasmaCore.Units.gridUnit
columnSpacing: PlasmaCore.Units.gridUnit
rows: container.effect.gridRows