plasma-framework/src/declarativeimports/plasmacomponents3/Page.qml
Noah Davis 9fd111d867 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.
2021-06-28 09:00:51 -04:00

21 lines
799 B
QML

/*
SPDX-FileCopyrightText: 2020 Niccolò Venerandi <niccolo@venerandi.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.6
import QtQuick.Templates @QQC2_VERSION@ as T
T.Page {
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))
}