summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <notmart@gmail.com>2017-01-09 12:41:05 (GMT)
committerMarco Martin <notmart@gmail.com>2017-01-09 12:41:05 (GMT)
commit05920ab34283dd91d6575e6f479c14b63a258c60 (patch)
treebb608df9fb17c6981db2212ff46e431a10f2f2fe
parentd2fde361d3c8fb40fb6c1e53e4178042799b6691 (diff)
fix binding loop
basing the cellWidth on the gridview width gives a problem when the scrollview passes from scrollbar to no scrollbar, as it may resize the contents, change the number of columns, cause reevalutation giving a binding loop, causing a freeze of the app BUG:374786
-rw-r--r--kcms/lookandfeel/package/contents/ui/main.qml3
1 files changed, 2 insertions, 1 deletions
diff --git a/kcms/lookandfeel/package/contents/ui/main.qml b/kcms/lookandfeel/package/contents/ui/main.qml
index d644f7d..9b8b9ff 100644
--- a/kcms/lookandfeel/package/contents/ui/main.qml
+++ b/kcms/lookandfeel/package/contents/ui/main.qml
@@ -28,6 +28,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kcm 1.0
Item {
+ id: root
implicitWidth: units.gridUnit * 20
implicitHeight: units.gridUnit * 20
@@ -48,7 +49,7 @@ Item {
GridView {
id: grid
model: kcm.lookAndFeelModel
- cellWidth: Math.floor(grid.width / Math.max(Math.floor(grid.width / (units.gridUnit*12)), 3))
+ cellWidth: Math.floor(root.width / Math.max(Math.floor(root.width / (units.gridUnit*12)), 3)) - units.gridUnit
cellHeight: cellWidth / 1.6
onCountChanged: {