Warning, /frameworks/kirigami/src/controls/AbstractItemViewHeader.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.5
0008 import QtQuick.Templates 2.0 as T2
0009 import org.kde.kirigami 2.4 as Kirigami
0010 
0011 // TODO KF6: remove this
0012 /**
0013  * @brief An item that can be used as an header for a ListView.
0014  *
0015  * It will play nice with the margin policies of ScrollablePage and can
0016  * automatically shrink when the list is scrolled, like the behavior
0017  * of list headers in many mobile applications.
0018  * @since org.kde.kirigami 2.1
0019  * @inherit QtQuick.Controls.Control
0020  * @deprecated This will be removed in KF6.
0021  */
0022 T2.Control {
0023     /**
0024      * @brief This property holds the minimum height of the AbstractItemViewHeader.
0025      */
0026     property int minimumHeight: Kirigami.Units.gridUnit * 2 + Kirigami.Units.smallSpacing * 2
0027 
0028     /**
0029      * @brief This property holds the maximum height of the AbstractItemViewHeader.
0030      */
0031     property int maximumHeight: Kirigami.Units.gridUnit * 6
0032 
0033     /**
0034      * @brief This property holds the ListView for which this item is the header.
0035      *
0036      * default: ``ListView.view``
0037      */
0038     property ListView view: ListView.view
0039 
0040     width: view.width
0041 
0042     implicitHeight: topPadding + bottomPadding + (view.headerPositioning === ListView.InlineHeader
0043                                                     ? maximumHeight
0044                                                     : Math.min(maximumHeight, Math.max(minimumHeight, maximumHeight - Math.max(0, view.contentY))))
0045 
0046 
0047     z: 9
0048     topPadding: applicationWindow() && !applicationWindow().wideScreen && applicationWindow().header ? applicationWindow().header.paintedHeight : 0
0049     rightPadding: Kirigami.Units.gridUnit
0050 
0051 }