Page.qml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (C) 2017 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. import QtQuick
  5. import QtQuick.Templates as T
  6. import QtQuick.Controls.Imagine
  7. import QtQuick.Controls.Imagine.impl
  8. T.Page {
  9. id: control
  10. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  11. implicitContentWidth + leftPadding + rightPadding,
  12. implicitHeaderWidth,
  13. implicitFooterWidth)
  14. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  15. implicitContentHeight + topPadding + bottomPadding
  16. + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
  17. + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
  18. topPadding: background ? background.topPadding : 0
  19. leftPadding: background ? background.leftPadding : 0
  20. rightPadding: background ? background.rightPadding : 0
  21. bottomPadding: background ? background.bottomPadding : 0
  22. topInset: background ? -background.topInset || 0 : 0
  23. leftInset: background ? -background.leftInset || 0 : 0
  24. rightInset: background ? -background.rightInset || 0 : 0
  25. bottomInset: background ? -background.bottomInset || 0 : 0
  26. background: NinePatchImage {
  27. source: Imagine.url + "page-background"
  28. NinePatchImageSelector on source {
  29. states: [
  30. {"disabled": !control.enabled},
  31. {"mirrored": control.mirrored}
  32. ]
  33. }
  34. }
  35. }