Skip to content

Commit fc9ec9e

Browse files
committed
chore: can't use ScrollView in qt5
as title.
1 parent 22f8682 commit fc9ec9e

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

src/qml/ScrollView.qml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,32 @@
22
//
33
// SPDX-License-Identifier: LGPL-3.0-or-later
44

5-
import QtQuick.Controls 2.4
5+
import QtQuick 2.12
6+
import QtQuick.Controls.impl 2.12
7+
import QtQuick.Templates 2.12 as T
8+
import org.deepin.dtk 1.0 as D
69

7-
ScrollView {
10+
T.ScrollView {
11+
id: control
812

13+
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
14+
contentWidth + leftPadding + rightPadding)
15+
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
16+
contentHeight + topPadding + bottomPadding)
17+
18+
D.ScrollBar.vertical: D.ScrollBar {
19+
parent: control
20+
x: control.mirrored ? 0 : control.width - width
21+
y: control.topPadding
22+
height: control.availableHeight
23+
active: control.D.ScrollBar.horizontal.active
24+
}
25+
26+
D.ScrollBar.horizontal: D.ScrollBar {
27+
parent: control
28+
x: control.leftPadding
29+
y: control.height - height
30+
width: control.availableWidth
31+
active: control.D.ScrollBar.vertical.active
32+
}
933
}

0 commit comments

Comments
 (0)