on xenial help sign in
fix leftMargin in spread
644d03aMichael Zanetti
qml/Stage/Spread/Spread.qml+3−2
@@ -8,6 +8,7 @@ Item {
8 // Information about the environment
8 // Information about the environment
9 property int highlightedIndex: 1
9 property int highlightedIndex: 1
10 property var model: null
10 property var model: null
11+ property int leftMargin: 0
11
12
12 // some config options
13 // some config options
13 property real contentMargin: 0.16 * root.height
14 property real contentMargin: 0.16 * root.height
@@ -23,8 +24,8 @@ Item {
23
24
24 // Calculated stuff
25 // Calculated stuff
25 readonly property int totalItemCount: model.count
26 readonly property int totalItemCount: model.count
26− readonly property real leftStackXPos: 0.03 * root.width
27+ readonly property real leftStackXPos: 0.03 * root.width + leftMargin
27− readonly property real rightStackXPos: root.width - 1.5 * leftStackXPos
28+ readonly property real rightStackXPos: root.width - 1.5 * leftStackXPos + leftMargin
28
29
29 readonly property real stackHeight: spreadItemHeight - appInfoHeight
30 readonly property real stackHeight: spreadItemHeight - appInfoHeight
30 readonly property real stackWidth: Math.min(leftStackXPos/3, units.gu(1.5))
31 readonly property real stackWidth: Math.min(leftStackXPos/3, units.gu(1.5))
qml/Stage/Spread/SpreadMaths.qml−1
@@ -28,7 +28,6 @@ Item {
28 property Spread spread: null
28 property Spread spread: null
29 property int itemIndex: 0
29 property int itemIndex: 0
30
30
31−
32 // Internal
31 // Internal
33 property real spreadPosition: itemIndex/spread.visibleItemCount - flickable.contentX/spread.spreadWidth // 0 -> left stack, 1 -> right stack
32 property real spreadPosition: itemIndex/spread.visibleItemCount - flickable.contentX/spread.spreadWidth // 0 -> left stack, 1 -> right stack
34 property real leftStackingProgress: MathUtils.clamp(MathUtils.map(spreadPosition, 0, -spread.stackItemCount/spread.visibleItemCount , 0, 1), 0, 1)
33 property real leftStackingProgress: MathUtils.clamp(MathUtils.map(spreadPosition, 0, -spread.stackItemCount/spread.visibleItemCount , 0, 1), 0, 1)
qml/Stage/Stage.qml+1
@@ -365,6 +365,7 @@ AbstractStage {
365 Spread {
365 Spread {
366 id: spreadItem
366 id: spreadItem
367 anchors.fill: appContainer
367 anchors.fill: appContainer
368+ leftMargin: root.leftMargin
368 model: root.topLevelSurfaceList
369 model: root.topLevelSurfaceList
369 z: 10
370 z: 10
370 }
371 }