From 9fd111d86737cd31d93cf7c71ac8dd0008e2396e Mon Sep 17 00:00:00 2001 From: Noah Davis Date: Mon, 28 Jun 2021 08:59:37 -0400 Subject: [PATCH] PC3 Page: Improve implicit size calculation Also remove unnecessary code for contentWidth/contentHeight. It's already handled the exact same way in the C++ of QQC2 Page. --- src/declarativeimports/plasmacomponents3/Page.qml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/declarativeimports/plasmacomponents3/Page.qml b/src/declarativeimports/plasmacomponents3/Page.qml index 66ef8ee6d..f23b6e120 100644 --- a/src/declarativeimports/plasmacomponents3/Page.qml +++ b/src/declarativeimports/plasmacomponents3/Page.qml @@ -8,10 +8,13 @@ import QtQuick 2.6 import QtQuick.Templates @QQC2_VERSION@ as T T.Page { - implicitWidth: contentWidth + leftPadding + rightPadding - implicitHeight: contentHeight + topPadding + bottomPadding - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) }