ScrollView.qml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2020 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.Controls.impl
  6. import QtQuick.Templates as T
  7. T.ScrollView {
  8. id: control
  9. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  10. implicitContentWidth + leftPadding + rightPadding)
  11. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  12. implicitContentHeight + topPadding + bottomPadding)
  13. ScrollBar.vertical: ScrollBar {
  14. parent: control
  15. x: control.mirrored ? 0 : control.width - width
  16. y: control.topPadding
  17. height: control.availableHeight
  18. active: control.ScrollBar.horizontal.active
  19. }
  20. ScrollBar.horizontal: ScrollBar {
  21. parent: control
  22. x: control.leftPadding
  23. y: control.height - height
  24. width: control.availableWidth
  25. active: control.ScrollBar.vertical.active
  26. }
  27. }