Kirigami2

FlexColumn.qml
1/*
2 * SPDX-FileCopyrightText: 2020 Carson Black <uhhadd@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7import QtQuick
8import QtQuick.Layouts
9import org.kde.kirigami as Kirigami
10
11//TODO KF6: how much is this used? can be removed?
12/**
13 * @brief FlexColumn is a column that grows in width to a fixed cap.
14 * @inherit QtQuick.Layouts.ColumnLayout
15 */
16ColumnLayout {
17 id: __outer
19 default property alias columnChildren: __inner.children
20
21 /**
22 * @brief This property holds the column's offset from the cross axis.
23 *
24 * Note that padding is applied on both sides
25 * when the column is aligned to a centered cross axis.
26 *
27 * default: ``Kirigami.Units.largeSpacing``
28 */
29 property real padding: Kirigami.Units.largeSpacing
30
31 /**
32 * @brief This property holds maximum column width.
33 *
34 * default: ``Kirigami.Units.gridUnit * 50``
35 */
36 property real maximumWidth: Kirigami.Units.gridUnit * 50
37
38 /**
39 * @brief This property sets column's alignment when it hits its maximum width.
40 *
41 * default: ``Qt.AlignHCenter | Qt.AlignTop``
42 *
43 * @property Qt::Alignment alignment
44 */
45 property int alignment: Qt.AlignHCenter | Qt.AlignTop
46
47 /**
48 * @brief This property holds the inner column's width.
49 */
50 property real innerWidth: __inner.width
51
52 Layout.fillWidth: true
53 Layout.fillHeight: true
54
55 enum CrossAxis {
56 Left,
57 Center,
58 Right
59 }
60
61 ColumnLayout {
62 id: __inner
63 spacing: __outer.spacing
64 Layout.maximumWidth: __outer.maximumWidth
65 Layout.leftMargin: __outer.alignment & Qt.AlignLeft || __outer.alignment & Qt.AlignHCenter ? __outer.padding : 0
66 Layout.rightMargin: __outer.alignment & Qt.AlignRight || __outer.alignment & Qt.AlignHCenter ? __outer.padding : 0
67 Layout.alignment: __outer.alignment
68 }
69}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.