Kirigami2
8 import QtQuick.Layouts 1.2
9 import org.kde.kirigami 2.4 as Kirigami
32 P.CardsGridViewPrivate {
44 property bool extraColumns:
true
50 readonly
property int columns: {
51 const minFromWidth = Math.floor(width / minimumColumnWidth)
52 const maxFromWidth = Math.ceil(width / maximumColumnWidth)
53 const extraCount = extraColumns ? Infinity : count
54 return Math.max(1,Math.min(maximumColumns,minFromWidth,maxFromWidth,extraCount))
64 property int maximumColumns: Kirigami.Units.maximumInteger
78 property int maximumColumnWidth: Kirigami.Units.gridUnit * 20
93 property int minimumColumnWidth: Kirigami.Units.gridUnit * 12
95 cellWidth: Math.floor(width/columns)
96 cellHeight: Math.max(Kirigami.Units.gridUnit * 15, Math.min(cellWidth, maximumColumnWidth) / 1.2)
102 default property alias delegate: root._delegateComponent
104 topMargin: Kirigami.Units.largeSpacing * 2
106 Keys.onPressed:
event => {
107 if (event.key ===
Qt.Key_Home) {
108 positionViewAtBeginning();
110 event.accepted =
true;
112 else if (event.key ===
Qt.Key_End) {
114 currentIndex = count - 1;
115 event.accepted =
true;
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.