|
55 | 55 | MZFlickable { |
56 | 56 | id: onboardingPanel |
57 | 57 |
|
58 | | - flickContentHeight: Math.max(window.safeContentHeight / 2 + col.implicitHeight, parent.height) |
| 58 | + flickContentHeight: parent.height |
59 | 59 | height: parent.height |
60 | 60 | width: parent.width |
61 | 61 |
|
@@ -100,7 +100,6 @@ Item { |
100 | 100 | // The extra 40 for iOS below is due to VPN-7497. Qt 6.10 upgrade seems to have changed how the status bar and bottom bar are |
101 | 101 | // calculated for iOS. We could re-do this entire layout with safeHitArea, but this is the quickest solution and the one needed |
102 | 102 | // right now. |
103 | | - property int _topMargin: (safeAreaHeight - ((Qt.platform.os === "ios" || Qt.platform.os === "android") ? 40 : 0)) / 2 - currentPanelValues._animationHeight |
104 | 103 | property bool _isFirstSlide: swipeView.currentIndex === 0 |
105 | 104 |
|
106 | 105 | id: swipeView |
@@ -133,8 +132,8 @@ Item { |
133 | 132 | anchors.fill: undefined |
134 | 133 | anchors.horizontalCenter: parent.horizontalCenter |
135 | 134 | anchors.top: parent.top |
136 | | - anchors.topMargin: swipeView._isFirstSlide ? 0 : swipeView._topMargin |
137 | | - height: currentPanelValues._animationHeight + (swipeView._isFirstSlide ? swipeView._topMargin : 0) |
| 135 | + anchors.topMargin: swipeView._isFirstSlide ? 0 : currentPanelValues._topMargin |
| 136 | + height: currentPanelValues._animationHeight + (swipeView._isFirstSlide ? currentPanelValues._topMargin : 0) |
138 | 137 | loop: loopAnimation |
139 | 138 | opacity: panelAnimation.imageOpacityValue |
140 | 139 | source: MZAssetLookup.getAnimationSource(animationSrc) |
@@ -264,14 +263,40 @@ Item { |
264 | 263 | property string _panelTitleText: "" |
265 | 264 | property string _panelDescriptionText: "" |
266 | 265 | property real _animationHeight: Math.min(240, safeAreaHeight * .35) |
| 266 | + // next line is 2/3 of empty space on the screen |
| 267 | + property int _topMargin: ((safeAreaHeight - ((Qt.platform.os === "ios" || Qt.platform.os === "android") ? 40 : 0)) - panelBottomContent.implicitHeight - panelTextMaxHeight - _animationHeight - headerLink.height) * 2 / 3 |
| 268 | + property real panelTextMaxHeight: 0 |
| 269 | + } |
| 270 | + |
| 271 | + // This next section isn't visible to the user. It is used to calcuate the largest text size, to use that for layout elsewhere. |
| 272 | + Repeater { |
| 273 | + model: onboardingModel |
| 274 | + delegate: ColumnLayout { |
| 275 | + visible: false |
| 276 | + width: parent.width |
| 277 | + spacing: MZTheme.the5me.windowMargin / 2 |
| 278 | + |
| 279 | + MZHeadline { |
| 280 | + Layout.fillWidth: true |
| 281 | + text: MZI18n[titleStringId] |
| 282 | + } |
| 283 | + MZSubtitle { |
| 284 | + Layout.fillWidth: true |
| 285 | + text: MZI18n[subtitleStringId] |
| 286 | + } |
| 287 | + |
| 288 | + Component.onCompleted: { |
| 289 | + currentPanelValues.panelTextMaxHeight = Math.max(currentPanelValues.panelTextMaxHeight, implicitHeight) |
| 290 | + } |
| 291 | + } |
267 | 292 | } |
268 | 293 |
|
269 | 294 | ColumnLayout { |
270 | 295 | id: col |
271 | 296 |
|
272 | 297 | anchors { |
273 | 298 | fill: parent |
274 | | - topMargin: onboardingPanel.height / 2 |
| 299 | + topMargin: currentPanelValues._animationHeight + currentPanelValues._topMargin |
275 | 300 | leftMargin: MZTheme.theme.windowMargin * 1.5 |
276 | 301 | rightMargin: MZTheme.theme.windowMargin * 1.5 |
277 | 302 | } |
|
0 commit comments