Verified Commit fc757be2 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

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.
parent 5af891ec
Pipeline #220866 passed with stage
in 17 minutes and 9 seconds
......@@ -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
......
Supports Markdown
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