Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/ScrollView.qml
Show All 33 Lines | 29 | T.ScrollView { | |||
---|---|---|---|---|---|
34 | @DISABLE_UNDER_QQC2_2_4@ palette: Kirigami.Theme.palette | 34 | @DISABLE_UNDER_QQC2_2_4@ palette: Kirigami.Theme.palette | ||
35 | implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) | 35 | implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) | ||
36 | implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) | 36 | implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) | ||
37 | 37 | | |||
38 | Kirigami.Theme.colorSet: Kirigami.Theme.View | 38 | Kirigami.Theme.colorSet: Kirigami.Theme.View | ||
39 | Kirigami.Theme.inherit: !background || !background.visible | 39 | Kirigami.Theme.inherit: !background || !background.visible | ||
40 | 40 | | |||
41 | //size in pixel to accomodate the border drawn by qstyle | 41 | //size in pixel to accomodate the border drawn by qstyle | ||
42 | leftPadding: background && background.visible && background.hasOwnProperty("leftPadding") ? background.leftPadding : 0 | 42 | leftPadding: (_backgroundVisible && background.hasOwnProperty("leftPadding") ? background.leftPadding : 0) + (LayoutMirroring.enabled ? _verticalScrollBarWidth : 0) | ||
43 | topPadding: background && background.visible && background.hasOwnProperty("topPadding") ? background.topPadding : 0 | 43 | topPadding: _backgroundVisible && background.hasOwnProperty("topPadding") ? background.topPadding : 0 | ||
44 | rightPadding: background && background.visible && background.hasOwnProperty("rightPadding") ? background.rightPadding : 0 | 44 | rightPadding: (_backgroundVisible && background.hasOwnProperty("rightPadding") ? background.rightPadding : 0) + (!LayoutMirroring.enabled ? _verticalScrollBarWidth : 0) | ||
45 | bottomPadding: background && background.visible && background.hasOwnProperty("bottomPadding") ? background.bottomPadding : 0 | 45 | bottomPadding: (_backgroundVisible && background.hasOwnProperty("bottomPadding") ? background.bottomPadding : 0) + _horizontalScrollBarWidth | ||
46 | | ||||
47 | readonly property bool _backgroundVisible: background && background.visible | ||||
mart: those properties should be top level, (even starting with _ )
there is stuff inside data… | |||||
48 | readonly property real _verticalScrollBarWidth: ScrollBar.vertical.visible ? ScrollBar.vertical.width : 0 | ||||
mart: it should also have the condition: !Kirigami.Settings.tabletMode | |||||
49 | readonly property real _horizontalScrollBarWidth: ScrollBar.horizontal.visible ? ScrollBar.horizontal.width : 0 | ||||
46 | 50 | | |||
47 | //create a background only after Component.onCompleted, see on the component creation below for explanation | 51 | //create a background only after Component.onCompleted, see on the component creation below for explanation | ||
48 | Component.onCompleted: { | 52 | Component.onCompleted: { | ||
49 | if (!controlRoot.background) { | 53 | if (!controlRoot.background) { | ||
50 | controlRoot.background = backgroundComponent.createObject(controlRoot); | 54 | controlRoot.background = backgroundComponent.createObject(controlRoot); | ||
51 | } | 55 | } | ||
52 | } | 56 | } | ||
53 | 57 | | |||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |
those properties should be top level, (even starting with _ )
there is stuff inside data: already, it can be put inside there