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: (internal.backgroundVisible && background.hasOwnProperty("leftPadding") ? background.leftPadding : 0) | ||
43 | topPadding: background && background.visible && background.hasOwnProperty("topPadding") ? background.topPadding : 0 | 43 | + (LayoutMirroring.enabled ? internal.verticalScrollBarWidth : 0) | ||
44 | rightPadding: background && background.visible && background.hasOwnProperty("rightPadding") ? background.rightPadding : 0 | 44 | topPadding: internal.backgroundVisible && background.hasOwnProperty("topPadding") ? background.topPadding : 0 | ||
45 | bottomPadding: background && background.visible && background.hasOwnProperty("bottomPadding") ? background.bottomPadding : 0 | 45 | rightPadding: (internal.backgroundVisible && background.hasOwnProperty("rightPadding") ? background.rightPadding : 0) | ||
46 | + (!LayoutMirroring.enabled ? internal.verticalScrollBarWidth : 0) | ||||
47 | bottomPadding: (internal.backgroundVisible && background.hasOwnProperty("bottomPadding") ? background.bottomPadding : 0) | ||||
mart: those properties should be top level, (even starting with _ )
there is stuff inside data… | |||||
48 | + internal.horizontalScrollBarWidth | ||||
mart: it should also have the condition: !Kirigami.Settings.tabletMode | |||||
46 | 49 | | |||
47 | //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 | ||
48 | Component.onCompleted: { | 51 | Component.onCompleted: { | ||
49 | if (!controlRoot.background) { | 52 | if (!controlRoot.background) { | ||
50 | controlRoot.background = backgroundComponent.createObject(controlRoot); | 53 | controlRoot.background = backgroundComponent.createObject(controlRoot); | ||
51 | } | 54 | } | ||
52 | } | 55 | } | ||
53 | 56 | | |||
Show All 28 Lines | 82 | StylePrivate.StyleItem { | |||
82 | control: controlRoot | 85 | control: controlRoot | ||
83 | elementType: "frame" | 86 | elementType: "frame" | ||
84 | visible: false | 87 | visible: false | ||
85 | sunken: true | 88 | sunken: true | ||
86 | hasFocus: controlRoot.activeFocus || controlRoot.contentItem.activeFocus | 89 | hasFocus: controlRoot.activeFocus || controlRoot.contentItem.activeFocus | ||
87 | hover: controlRoot.hovered | 90 | hover: controlRoot.hovered | ||
88 | } | 91 | } | ||
89 | } | 92 | } | ||
93 | }, | ||||
94 | | ||||
95 | QtObject { | ||||
96 | id: internal | ||||
97 | | ||||
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 | ||||
100 | readonly property real horizontalScrollBarWidth: controlRoot.ScrollBar.horizontal.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.horizontal.width : 0 | ||||
90 | } | 101 | } | ||
91 | ] | 102 | ] | ||
92 | ScrollBar.vertical: ScrollBar { | 103 | ScrollBar.vertical: ScrollBar { | ||
93 | id: verticalScrollBar | 104 | id: verticalScrollBar | ||
94 | parent: controlRoot | 105 | parent: controlRoot | ||
95 | enabled: controlRoot.contentItem.enabled | 106 | enabled: controlRoot.contentItem.enabled | ||
96 | x: controlRoot.mirrored ? 0 : controlRoot.width - width | 107 | x: controlRoot.mirrored ? 0 : controlRoot.width - width | ||
97 | y: controlRoot.topPadding | 108 | y: controlRoot.topPadding | ||
Show All 13 Lines |
those properties should be top level, (even starting with _ )
there is stuff inside data: already, it can be put inside there