on xenial help sign in
Rework the allowedOverlapCase for LVWPH sections
commit9ae41b6a6e8f6fee767c7efd5852ea131e575485 authorAlbert Astals <albert.astals@canonical.com> dateThu 27 Jun 2013, 11:50 (13 years ago) parent5602cfa
3 files changed+6−11
Components/ListItems/Base.qml+6−1 Components/ListItems/Header.qml−6 Components/ListItems/ThinDivider.qml−4
Components/ListItems/Base.qml+6−1
@@ -68,11 +68,16 @@ AbstractButton {
6868 return true;
6969 }
7070
71+ /* Relevant really only for ListViewWithPageHeader case: specify how many pixels we can overlap with the section header */
72+ readonly property int allowedOverlap: units.dp(1)
73+
7174 property real __heightToClip: {
7275 // Check this is in position where clipping is needed
7376 if (typeof ListViewWithPageHeader !== 'undefined') {
7477 if (typeof heightToClip !== 'undefined') {
75− return heightToClip;
78+ if (heightToClip >= allowedOverlap) {
79+ return heightToClip - allowedOverlap;
80+ }
7681 }
7782 }
7883 return 0;
Components/ListItems/Header.qml−6
@@ -25,12 +25,6 @@ Item {
2525 */
2626 property alias text: label.text
2727
28− /* When this header is used in a ListViewWithPageHeader with CurrentLabelAtStart mode, to stop
29− the list's delegates contents being visible through this header, they clip themselves
30− depending on their position. However to allow delegates underlap the bottom X pixels of this
31− header (so delegate appears through ThinDivider say) we set an offset property here. */
32− readonly property int bottomBorderAllowedOverlap: bottomBorder.allowedBottomOverlap
33−
3428 height: units.gu(4.5)
3529
3630 Item {
Components/ListItems/ThinDivider.qml−4
@@ -23,9 +23,5 @@ Image {
2323 }
2424 height: (visible) ? units.dp(2) : 0
2525
26− /* Relevant really only for ListViewWithPageHeader with Base delegates: should this image
27− be overlapping content, specify how many pixels from the bottom should be transparent */
28− readonly property int allowedBottomOverlap: units.dp(1)
29−
3026 source: "graphics/ListItemDividerHorizontal.png"
3127}