Move header definition from EditAccount to HPage

This commit is contained in:
miruka
2019-07-16 12:53:52 -04:00
parent a813b1c715
commit 96745902f3
4 changed files with 43 additions and 31 deletions

View File

@@ -11,6 +11,9 @@ SwipeView {
property alias page: innerPage
property alias flickable: innerFlickable
property alias headerLabel: innerHeaderLabel
property var hideHeaderUnderHeight: null
property bool wide: width > 414 + leftPadding + rightPadding
property int currentSpacing:
@@ -32,6 +35,41 @@ SwipeView {
id: innerPage
background: null
header: HRectangle {
width: parent.width
implicitWidth: parent.width
color: theme.pageHeadersBackground
height: ! hideHeaderUnderHeight ||
window.height >=
hideHeaderUnderHeight +
theme.baseElementsHeight +
currentSpacing * 2 ?
theme.baseElementsHeight : 0
Behavior on height { HNumberAnimation {} }
visible: height > 0
HRowLayout {
width: parent.width
HLabel {
id: innerHeaderLabel
text: qsTr("Account settings for %1").arg(
Utils.coloredNameHtml(userInfo.displayName, userId)
)
textFormat: Text.StyledText
font.pixelSize: theme.fontSize.big
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
Layout.leftMargin: currentSpacing
Layout.rightMargin: Layout.leftMargin
Layout.fillWidth: true
}
}
}
leftPadding: currentSpacing < theme.spacing ? 0 : currentSpacing
rightPadding: leftPadding
Behavior on leftPadding { HNumberAnimation {} }