Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/ScrollView.qml
Show All 39 Lines | 29 | T.ScrollView { | |||
---|---|---|---|---|---|
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: (internal.backgroundVisible && background.hasOwnProperty("leftPadding") ? background.leftPadding : 0) | 42 | leftPadding: (internal.backgroundVisible && background.hasOwnProperty("leftPadding") ? background.leftPadding : 0) | ||
43 | + (LayoutMirroring.enabled ? internal.verticalScrollBarWidth : 0) | 43 | + (LayoutMirroring.enabled ? internal.verticalScrollBarWidth : 0) | ||
44 | topPadding: internal.backgroundVisible && background.hasOwnProperty("topPadding") ? background.topPadding : 0 | 44 | topPadding: internal.backgroundVisible && background.hasOwnProperty("topPadding") ? background.topPadding : 0 | ||
45 | rightPadding: (internal.backgroundVisible && background.hasOwnProperty("rightPadding") ? background.rightPadding : 0) | 45 | rightPadding: (internal.backgroundVisible && background.hasOwnProperty("rightPadding") ? background.rightPadding : 0) | ||
46 | + (!LayoutMirroring.enabled ? internal.verticalScrollBarWidth : 0) | 46 | + (!LayoutMirroring.enabled ? internal.verticalScrollBarWidth : 0) | ||
47 | bottomPadding: (internal.backgroundVisible && background.hasOwnProperty("bottomPadding") ? background.bottomPadding : 0) | 47 | bottomPadding: (internal.backgroundVisible && background.hasOwnProperty("bottomPadding") ? background.bottomPadding : 0) | ||
48 | + internal.horizontalScrollBarWidth | 48 | + internal.horizontalScrollBarHeight | ||
49 | 49 | | |||
50 | //create a background only after Component.onCompleted, see on the component creation below for explanation | 50 | //create a background only after Component.onCompleted, see on the component creation below for explanation | ||
51 | Component.onCompleted: { | 51 | Component.onCompleted: { | ||
52 | if (!controlRoot.background) { | 52 | if (!controlRoot.background) { | ||
53 | controlRoot.background = backgroundComponent.createObject(controlRoot); | 53 | controlRoot.background = backgroundComponent.createObject(controlRoot); | ||
54 | } | 54 | } | ||
55 | } | 55 | } | ||
56 | 56 | | |||
Show All 35 Lines | 66 | Component { | |||
92 | } | 92 | } | ||
93 | }, | 93 | }, | ||
94 | 94 | | |||
95 | QtObject { | 95 | QtObject { | ||
96 | id: internal | 96 | id: internal | ||
97 | 97 | | |||
98 | readonly property bool backgroundVisible: controlRoot.background && controlRoot.background.visible | 98 | readonly property bool backgroundVisible: controlRoot.background && controlRoot.background.visible | ||
99 | readonly property real verticalScrollBarWidth: controlRoot.ScrollBar.vertical.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.vertical.width : 0 | 99 | readonly property real verticalScrollBarWidth: controlRoot.ScrollBar.vertical.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.vertical.width : 0 | ||
100 | readonly property real horizontalScrollBarWidth: controlRoot.ScrollBar.horizontal.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.horizontal.width : 0 | 100 | readonly property real horizontalScrollBarHeight: controlRoot.ScrollBar.horizontal.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.horizontal.height : 0 | ||
101 | } | 101 | } | ||
102 | ] | 102 | ] | ||
103 | ScrollBar.vertical: ScrollBar { | 103 | ScrollBar.vertical: ScrollBar { | ||
104 | id: verticalScrollBar | 104 | id: verticalScrollBar | ||
105 | parent: controlRoot | 105 | parent: controlRoot | ||
106 | enabled: controlRoot.contentItem.enabled | 106 | enabled: controlRoot.contentItem.enabled | ||
107 | 107 | | |||
108 | x: controlRoot.mirrored | 108 | x: controlRoot.mirrored | ||
Show All 16 Lines |