aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/ScrollView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/material/ScrollView.qml')
-rw-r--r--src/quickcontrols/material/ScrollView.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/quickcontrols/material/ScrollView.qml b/src/quickcontrols/material/ScrollView.qml
new file mode 100644
index 0000000000..60789313c9
--- /dev/null
+++ b/src/quickcontrols/material/ScrollView.qml
@@ -0,0 +1,31 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls.impl
+import QtQuick.Templates as T
+
+T.ScrollView {
+ id: control
+
+ implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ contentHeight + topPadding + bottomPadding)
+
+ ScrollBar.vertical: ScrollBar {
+ parent: control
+ x: control.mirrored ? 0 : control.width - width
+ y: control.topPadding
+ height: control.availableHeight
+ active: control.ScrollBar.horizontal.active
+ }
+
+ ScrollBar.horizontal: ScrollBar {
+ parent: control
+ x: control.leftPadding
+ y: control.height - height
+ width: control.availableWidth
+ active: control.ScrollBar.vertical.active
+ }
+}