use the new Kirigami.WheelHandler
This commit is contained in:
parent
b5ec56091e
commit
bdb2783b0d
@ -24,6 +24,7 @@ import QtQuick 2.9
|
|||||||
import QtQuick.Controls @QQC2_VERSION@
|
import QtQuick.Controls @QQC2_VERSION@
|
||||||
import QtQuick.Templates @QQC2_VERSION@ as T
|
import QtQuick.Templates @QQC2_VERSION@ as T
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
import org.kde.kirigami 2.9 as Kirigami
|
||||||
|
|
||||||
T.ScrollView {
|
T.ScrollView {
|
||||||
id: controlRoot
|
id: controlRoot
|
||||||
@ -33,8 +34,6 @@ T.ScrollView {
|
|||||||
implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
|
implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
|
||||||
implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
|
implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
|
||||||
|
|
||||||
contentWidth: verticalScrollBar.flickableItem ? verticalScrollBar.flickableItem.contentWidth : 0
|
|
||||||
contentHeight: verticalScrollBar.flickableItem ? verticalScrollBar.flickableItem.contentHeight : 0
|
|
||||||
|
|
||||||
//create a background only after Component.onCompleted, see on the component creation below for explanation
|
//create a background only after Component.onCompleted, see on the component creation below for explanation
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
@ -44,14 +43,19 @@ T.ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
data: [ Component {
|
data: [
|
||||||
|
Kirigami.WheelHandler {
|
||||||
|
target: controlRoot.contentItem
|
||||||
|
},
|
||||||
|
Component {
|
||||||
id: backgroundComponent
|
id: backgroundComponent
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: theme.viewBackgroundColor
|
color: theme.viewBackgroundColor
|
||||||
visible: false
|
visible: false
|
||||||
anchors.fill:parent
|
anchors.fill:parent
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: ScrollBar {
|
||||||
id: verticalScrollBar
|
id: verticalScrollBar
|
||||||
|
Loading…
Reference in New Issue
Block a user