on xenial help sign in
fix leftMargin in spread
commit644d03a0f4e49792e745383f3bb65f998d4db3cd authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 5 Aug 2016, 15:58 (10 years ago) parentb7d65a3
3 files changed+4−3
qml/Stage/Spread/Spread.qml+3−2 qml/Stage/Spread/SpreadMaths.qml−1 qml/Stage/Stage.qml+1
qml/Stage/Spread/Spread.qml+3−2
@@ -8,6 +8,7 @@ Item {
88 // Information about the environment
99 property int highlightedIndex: 1
1010 property var model: null
11+ property int leftMargin: 0
1112
1213 // some config options
1314 property real contentMargin: 0.16 * root.height
@@ -23,8 +24,8 @@ Item {
2324
2425 // Calculated stuff
2526 readonly property int totalItemCount: model.count
26− readonly property real leftStackXPos: 0.03 * root.width
27− readonly property real rightStackXPos: root.width - 1.5 * leftStackXPos
27+ readonly property real leftStackXPos: 0.03 * root.width + leftMargin
28+ readonly property real rightStackXPos: root.width - 1.5 * leftStackXPos + leftMargin
2829
2930 readonly property real stackHeight: spreadItemHeight - appInfoHeight
3031 readonly property real stackWidth: Math.min(leftStackXPos/3, units.gu(1.5))
qml/Stage/Spread/SpreadMaths.qml−1
@@ -28,7 +28,6 @@ Item {
2828 property Spread spread: null
2929 property int itemIndex: 0
3030
31−
3231 // Internal
3332 property real spreadPosition: itemIndex/spread.visibleItemCount - flickable.contentX/spread.spreadWidth // 0 -> left stack, 1 -> right stack
3433 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 {
365365 Spread {
366366 id: spreadItem
367367 anchors.fill: appContainer
368+ leftMargin: root.leftMargin
368369 model: root.topLevelSurfaceList
369370 z: 10
370371 }