Kirigami2

AbstractItemViewHeader.qml
1 /*
2  * SPDX-FileCopyrightText: 2017 Marco Martin <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 import QtQuick 2.5
8 import QtQuick.Templates 2.0 as T2
9 import org.kde.kirigami 2.4 as Kirigami
10 
11 /**
12  * @brief An item that can be used as an header for a ListView.
13  *
14  * It will play nice with the margin policies of ScrollablePage and can
15  * automatically shrink when the list is scrolled, like the behavior
16  * of list headers in many mobile applications.
17  * @since 2.1
18  * @inherit QtQuick.Controls.Control
19  * @deprecated since 5.97; Don't use AbstractItemViewHeader in your views anymore.
20  *
21  * TODO KF6: remove
22  */
23 T2.Control {
24  /**
25  * @brief This property holds the minimum height of the AbstractItemViewHeader.
26  */
27  property int minimumHeight: Kirigami.Units.gridUnit * 2 + Kirigami.Units.smallSpacing * 2
28 
29  /**
30  * @brief This property holds the maximum height of the AbstractItemViewHeader.
31  */
32  property int maximumHeight: Kirigami.Units.gridUnit * 6
33 
34  /**
35  * @brief This property holds the ListView for which this item is the header.
36  *
37  * By default automatically set to the attached property: `ListView.view`.
38  */
39  property ListView view: ListView.view
40 
41  width: view.width
42 
43  implicitHeight: topPadding + bottomPadding + (view.headerPositioning === ListView.InlineHeader
44  ? maximumHeight
45  : Math.min(maximumHeight, Math.max(minimumHeight, maximumHeight - Math.max(0, view.contentY))))
46 
47 
48  z: 9
49  topPadding: applicationWindow() && !applicationWindow().wideScreen && applicationWindow().header ? applicationWindow().header.paintedHeight : 0
50  rightPadding: Kirigami.Units.gridUnit
51 
52 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:14:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.