Kirigami2

styles/Material/SwipeListItem.qml
1 /*
2  * SPDX-FileCopyrightText: 2010 Marco Martin <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 import QtQuick 2.5
8 import org.kde.kirigami 2.4
9 import QtQuick.Controls.Material 2.1 as Mat
10 import QtQuick.Controls.Material.impl 2.1 as MatImp
11 import "../../private"
12 import "../../templates" as T
13 
14 /**
15  * An item delegate Intended to support extra actions obtainable
16  * by uncovering them by dragging away the item with the handle
17  * This acts as a container for normal list items.
18  * Any subclass of AbstractListItem can be assigned as the contentItem property.
19  * @code
20  * ListView {
21  * model: myModel
22  * delegate: SwipeListItem {
23  * Label {
24  * text: model.text
25  * }
26  * actions: [
27  * Action {
28  * icon.name: "document-decrypt"
29  * onTriggered: print("Action 1 clicked")
30  * },
31  * Action {
32  * icon.name: model.action2Icon
33  * onTriggered: //do something
34  * }
35  * ]
36  * }
37  *
38  * }
39  * @endcode
40  *
41  * @inherit QtQuick.Item
42  */
43 T.SwipeListItem {
44  id: listItem
45 
46  background: DefaultListItemBackground {
47  MatImp.Ripple {
48  anchors.fill: parent
49  clip: visible
50  pressed: listItem.pressed
51  anchor: listItem
52  active: listItem.down || listItem.visualFocus
53  color: Qt.rgba(0,0,0,0.2)
54  }
55  }
56  implicitHeight: contentItem.implicitHeight + Units.smallSpacing * 6
57 }
int smallSpacing
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 16 2022 03:57:01 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.