Warning, /libraries/kirigami-addons/src/formcard/AbstractFormDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright 2022 Devin Lin <devin@kde.org>
0003  * SPDX-License-Identifier: LGPL-2.0-or-later
0004  */
0005 
0006 import QtQuick 2.15
0007 import QtQuick.Templates 2.15 as T
0008 import QtQuick.Layouts 1.15
0009 
0010 import org.kde.kirigami 2.12 as Kirigami
0011 
0012 /**
0013  * @brief A base item for delegates to be used in a FormCard.
0014  *
0015  * This component can be used to create your own custom FormCard delegates.
0016  *
0017  * By default, it includes a background with hover and click feedback.
0018  * Set the `background` property to Item {} to remove it.
0019  *
0020  * @since KirigamiAddons 0.11.0
0021  *
0022  * @see FormDelegateBackground
0023  *
0024  * @inherit QtQuick.Controls.ItemDelegate
0025  */
0026 T.ItemDelegate {
0027     id: root
0028 
0029     horizontalPadding: Kirigami.Units.gridUnit
0030     verticalPadding: Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing
0031 
0032     implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
0033     implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
0034 
0035     focusPolicy: Qt.StrongFocus
0036     hoverEnabled: true
0037     background: FormDelegateBackground { control: root }
0038 
0039     Layout.fillWidth: true
0040 }
0041