Add margin handling
This commit is contained in:
parent
c1ff089513
commit
ed8e26e67e
@ -43,6 +43,8 @@ Page {
|
||||
// a deepter layer as we need to include it in the blurring of the header and footer.
|
||||
// We don't want to paint the background on the entire screen twice (overdraw is costly)
|
||||
background: null
|
||||
readonly property bool applyRootItemBottomMarginCompaction: true
|
||||
readonly property int bottomMargin: footer.shown ? contentContainer.footerSize : 0
|
||||
|
||||
function configureViews() {
|
||||
if (Configuration.hasOwnProperty("mainViewsFilter")) {
|
||||
|
||||
@ -37,11 +37,25 @@ import "connection"
|
||||
Item {
|
||||
id: root
|
||||
|
||||
readonly property var currentPage: swipeView.currentItem ? swipeView.currentItem.pageStack.currentItem : null
|
||||
readonly property bool currentPageCompactsBottomMargin: currentPage
|
||||
&& currentPage.hasOwnProperty("applyRootItemBottomMarginCompaction")
|
||||
&& currentPage.applyRootItemBottomMarginCompaction
|
||||
readonly property bool currentPageDefinesBottomMargin: currentPage && currentPage.hasOwnProperty("bottomMargin")
|
||||
readonly property int currentPageBottomMargin: currentPageDefinesBottomMargin ? currentPage.bottomMargin : 0
|
||||
|
||||
readonly property int safeAreaBottomMargin: {
|
||||
if (Qt.platform.os !== "ios") {
|
||||
return PlatformHelper.bottomPadding
|
||||
var margin = PlatformHelper.bottomPadding
|
||||
|
||||
if (Qt.platform.os === "ios") {
|
||||
margin = Math.round(PlatformHelper.bottomPadding * Math.max(0, Configuration.iosSafeAreaBottomMarginScale))
|
||||
|
||||
if (currentPageCompactsBottomMargin && !app.landscape && currentPageBottomMargin > 0 && margin > 0) {
|
||||
margin = Math.floor(margin * 0.5)
|
||||
}
|
||||
}
|
||||
return Math.round(PlatformHelper.bottomPadding * Math.max(0, Configuration.iosSafeAreaBottomMarginScale))
|
||||
|
||||
return margin
|
||||
}
|
||||
|
||||
function handleAndroidBackButton() {
|
||||
|
||||
Reference in New Issue
Block a user