Libplasma

DialogButtonBox.qml
1/*
2 SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7import QtQuick
8import QtQuick.Templates as T
9import org.kde.kirigami as Kirigami
10
11T.DialogButtonBox {
12 id: control
13
14 implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
15 implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
16
17 spacing: Kirigami.Units.smallSpacing
18
19 topPadding: (parent as T.Control)?.topPadding ?? undefined
20 leftPadding: (parent as T.Control)?.leftPadding ?? undefined
21 rightPadding: (parent as T.Control)?.rightPadding ?? undefined
22 bottomPadding: (parent as T.Control)?.bottomPadding ?? undefined
23
24 alignment: Qt.AlignRight
25
26 delegate: Button {
27 width: Math.min(implicitWidth, control.width / control.count - control.rightPadding - control.spacing * (control.count-1))
28 }
29
30 contentItem: ListView {
31 implicitWidth: contentWidth
32 implicitHeight: Kirigami.Units.gridUnit * 1.6
33
34 model: control.contentModel
35 spacing: control.spacing
36 orientation: ListView.Horizontal
37 boundsBehavior: Flickable.StopAtBounds
38 snapMode: ListView.SnapToItem
39 }
40
41 background: Item {}
42}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.