diff --git a/org.kde.desktop/ScrollView.qml b/org.kde.desktop/ScrollView.qml --- a/org.kde.desktop/ScrollView.qml +++ b/org.kde.desktop/ScrollView.qml @@ -22,11 +22,12 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 -//import QtQuick.Controls.impl 2.2 import QtQuick.Templates 2.2 as T +import org.kde.kirigami 2.2 as Kirigami +import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate T.ScrollView { - id: control + id: controlRoot clip: true @@ -36,9 +37,30 @@ contentWidth: scrollHelper.flickableItem ? scrollHelper.flickableItem.contentWidth : 0 contentHeight: scrollHelper.flickableItem ? scrollHelper.flickableItem.contentHeight : 0 + Kirigami.Theme.colorSet: Kirigami.Theme.View + Kirigami.Theme.inherit: background.visible + + Component { + id: backgroundComponent + StylePrivate.StyleItem { + control: controlRoot + visible: false + elementType: "frame" + + sunken: true + hasFocus: controlRoot.activeFocus + hover: controlRoot.hovered + } + } + Component.onCompleted: { + if (!controlRoot.background) { + controlRoot.background = backgroundComponent.createObject(controlRoot) + } + } + onChildrenChanged: { - if (control.children[control.children.length - 1].hasOwnProperty("contentY")) { - scrollHelper.flickableItem = control.children[control.children.length - 1]; + if (controlRoot.children[controlRoot.children.length - 1].hasOwnProperty("contentY")) { + scrollHelper.flickableItem = controlRoot.children[controlRoot.children.length - 1]; } } children: [ @@ -86,18 +108,18 @@ ] ScrollBar.vertical: ScrollBar { id: verticalScrollBar - parent: control - x: control.mirrored ? 0 : control.width - width - y: control.topPadding - height: control.availableHeight - active: control.ScrollBar.horizontal || control.ScrollBar.horizontal.active + parent: controlRoot + x: controlRoot.mirrored ? 0 : controlRoot.width - width + y: controlRoot.topPadding + height: controlRoot.availableHeight + active: controlRoot.ScrollBar.horizontal || controlRoot.ScrollBar.horizontal.active } ScrollBar.horizontal: ScrollBar { - parent: control - x: control.leftPadding - y: control.height - height - width: control.availableWidth - active: control.ScrollBar.vertical || control.ScrollBar.vertical.active + parent: controlRoot + x: controlRoot.leftPadding + y: controlRoot.height - height + width: controlRoot.availableWidth + active: controlRoot.ScrollBar.vertical || controlRoot.ScrollBar.vertical.active } }