Skip to content

Commit

Permalink
Properly set contents height, to allow for header
Browse files Browse the repository at this point in the history
This requires adjusting some positioning code that assumed that
bottomEdge.height == page.height.
  • Loading branch information
rschroll committed Mar 8, 2015
1 parent efdbeba commit 5df04d4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ui/components/PageWithBottomEdge.qml
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ Page {
left: parent.left
right: parent.right
}
height: page.height
y: height
height: page.height - fakeHeader.height
y: page.height

visible: !page.isCollapsed
state: "collapsed"
Expand All @@ -300,15 +300,15 @@ Page {
name: "collapsed"
PropertyChanges {
target: bottomEdge
y: bottomEdge.height
y: page.height
}
PropertyChanges {
target: fakeHeader
y: -fakeHeader.height
}
PropertyChanges {
target: controls
y: bottomEdge.height
y: page.height
}
},
State {
Expand All @@ -327,7 +327,7 @@ Page {
when: mouseArea.drag.active
PropertyChanges {
target: bottomEdge
opacity: Math.min((bottomEdge.height - bottomEdge.y) / bottomEdgeExpandThreshold,
opacity: Math.min((page.height - bottomEdge.y) / bottomEdgeExpandThreshold,
1)
}
PropertyChanges {
Expand All @@ -339,26 +339,26 @@ Page {
y: {
var threshold = page.height - bottomEdgeExpandThreshold - bottomEdge.tipHeight
if (bottomEdge.y > threshold)
Math.max(bottomEdge.y, bottomEdge.height - controls.fullHeight)
Math.max(bottomEdge.y, page.height - controls.fullHeight)
else
Math.min(bottomEdge.height - controls.fullHeight + threshold - bottomEdge.y,
bottomEdge.height)
Math.min(page.height - controls.fullHeight + threshold - bottomEdge.y,
page.height)
}
}
},
State {
name: "controls"
PropertyChanges {
target: bottomEdge
y: bottomEdge.height
y: page.height
}
PropertyChanges {
target: fakeHeader
y: -fakeHeader.height
}
PropertyChanges {
target: controls
y: bottomEdge.height - controls.fullHeight
y: page.height - controls.fullHeight
}
}
]
Expand Down Expand Up @@ -519,7 +519,7 @@ Page {
maximumY: page.height
}
enabled: bottomEdge.state == "controls"
visible: (y < bottomEdge.height)
visible: (y < page.height)

anchors {
left: parent.left
Expand Down

0 comments on commit 5df04d4

Please sign in to comment.