Skip to content

Commit b207fdc

Browse files
Johnny Carlsonhebasto
authored andcommitted
qml: allow ContinueButton to stay at the bottom
With the ScrollView now containing the InformationPages, the ContinueButton was not able to stick to the bottom of the view due to contentHeight being too limited. This allows contentHeight to grow with the screen while limiting it so the button doesn't overlap with the information. Github-Pull: #194 Rebased-From: d17e309
1 parent 847ba98 commit b207fdc

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/qml/BitcoinApp/Controls/InformationPage.qml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import org.bitcoincore.qt
99

1010
Page {
1111
id: root
12+
implicitHeight: parent.height
1213
property alias bannerItem: banner_loader.sourceComponent
1314
property alias detailItem: detail_loader.sourceComponent
1415
property alias navLeftDetail: navbar.leftDetail
@@ -41,12 +42,11 @@ Page {
4142
}
4243

4344
ScrollView {
45+
id: scrollView
4446
width: parent.width
4547
height: parent.height
4648
clip: true
4749
contentWidth: width
48-
contentHeight: information.height + continueButton.height
49-
+ continueButton.anchors.topMargin + continueButton.anchors.bottomMargin
5050

5151
ColumnLayout {
5252
id: information
@@ -115,6 +115,18 @@ Page {
115115
anchors.top: undefined
116116
anchors.bottom: continueButton.parent.bottom
117117
}
118+
PropertyChanges {
119+
target: scrollView
120+
contentHeight: {
121+
var combinedHeight = information.height + continueButton.height
122+
+ continueButton.anchors.topMargin + continueButton.anchors.bottomMargin
123+
if (scrollView.height < combinedHeight) {
124+
return combinedHeight
125+
} else {
126+
return scrollView.height
127+
}
128+
}
129+
}
118130
},
119131
State {
120132
name: "DESKTOP"
@@ -123,6 +135,11 @@ Page {
123135
anchors.top: information.bottom
124136
anchors.bottom: undefined
125137
}
138+
PropertyChanges {
139+
target: scrollView
140+
contentHeight: information.height + continueButton.height
141+
+ continueButton.anchors.topMargin + continueButton.anchors.bottomMargin
142+
}
126143
}
127144
]
128145
}

0 commit comments

Comments
 (0)