diff --git a/src/controls/AbstractItemViewHeader.qml b/src/controls/AbstractItemViewHeader.qml --- a/src/controls/AbstractItemViewHeader.qml +++ b/src/controls/AbstractItemViewHeader.qml @@ -32,11 +32,13 @@ property int minimumHeight: Kirigami.Units.gridUnit * 2 + Kirigami.Units.smallSpacing * 2 property int maximumHeight: Kirigami.Units.gridUnit * 6 - property Flickable view: ListView.view + property ListView view: ListView.view - width: page.width + width: view.width - implicitHeight: Math.min(maximumHeight, Math.max(minimumHeight, -page.flickable.contentY - (view.headerPositioning == ListView.InlineHeader ? minimumHeight : 0) + minimumHeight)) + topPadding + bottomPadding + implicitHeight: topPadding + bottomPadding + (view.headerPositioning == ListView.InlineHeader + ? maximumHeight + : Math.min(maximumHeight, Math.max(minimumHeight, maximumHeight - Math.max(0, view.contentY)))) z: 9 topPadding: applicationWindow() && !applicationWindow().wideScreen && applicationWindow().header ? applicationWindow().header.paintedHeight : 0 diff --git a/src/controls/ItemViewHeader.qml b/src/controls/ItemViewHeader.qml --- a/src/controls/ItemViewHeader.qml +++ b/src/controls/ItemViewHeader.qml @@ -38,9 +38,10 @@ property alias backgroundImage: image - maximumHeight: (backgroundImage.status == Image.Ready ? 10 : 6) * Kirigami.Units.gridUnit + maximumHeight: (backgroundImage.status == Image.Ready || backgroundImage.status == Image.Loading ? 10 : 6) * Kirigami.Units.gridUnit background: Rectangle { + id: backgroundItem color: Kirigami.Theme.backgroundColor Image { id: image @@ -61,16 +62,16 @@ } } - property Page page: { + readonly property Page page: { var obj = root.view; while(obj && !obj.hasOwnProperty("title") && !obj.hasOwnProperty("isCurrentPage")) { obj = obj.parent } return obj; } Rectangle { id: rect - color: page.isCurrentPage ? Kirigami.Theme.highlightColor : Kirigami.Theme.disabledTextColor + color: backgroundItem.page.isCurrentPage ? Kirigami.Theme.highlightColor : Kirigami.Theme.disabledTextColor height: Kirigami.Units.smallSpacing anchors { left: parent.left