Section.qml 825 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import QtQuick 2.12
  2. import Felgo 4.0
  3. Rectangle {
  4. id: root
  5. default property alias content: contentItem.children
  6. property alias title: titleSection.title
  7. property real topPadding: dp(10)
  8. property real bottomPadding: 0
  9. property real margin: 0
  10. property real spacing: 0
  11. width: parent.width
  12. height: titleSection.height + contentItem.height + topPadding + bottomPadding
  13. color: Theme.backgroundColor
  14. SimpleSection {
  15. id: titleSection
  16. height: dp(30)
  17. }
  18. Column {
  19. id: contentItem
  20. anchors {
  21. horizontalCenter: parent.horizontalCenter
  22. top: titleSection.bottom
  23. topMargin: root.topPadding
  24. }
  25. width: parent.width - 2 * root.margin
  26. spacing: root.spacing
  27. }
  28. Item {
  29. anchors.top: contentItem.bottom
  30. width: parent.width
  31. height: root.bottomPadding
  32. }
  33. }