Libplasma

ItemDelegate.qml
1/*
2 SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
3 SPDX-FileCopyrightText: 2022-2024 ivan (@ratijas) tkachenko <me@ratijas.tk>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8import QtQuick
9import QtQuick.Templates as T
10import org.kde.kirigami as Kirigami
11import org.kde.ksvg as KSvg
12import "private" as Private
13
14T.ItemDelegate {
15 id: control
16
17 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
18 implicitContentWidth + leftPadding + rightPadding,
19 implicitIndicatorWidth + leftPadding + rightPadding)
20 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
21 implicitContentHeight + topPadding + bottomPadding,
22 implicitIndicatorHeight + topPadding + bottomPadding)
23
24 baselineOffset: contentItem.y + contentItem.baselineOffset
25 hoverEnabled: true
26
27 topPadding: (background as KSvg.FrameSvgItem)?.margins.top ?? undefined
28 leftPadding: (background as KSvg.FrameSvgItem)?.margins.left ?? undefined
29 rightPadding: (background as KSvg.FrameSvgItem)?.margins.right ?? undefined
30 bottomPadding: (background as KSvg.FrameSvgItem)?.margins.bottom ?? undefined
31
32 spacing: Kirigami.Units.smallSpacing
33
34 icon.width: Kirigami.Units.iconSizes.sizeForLabels
35 icon.height: Kirigami.Units.iconSizes.sizeForLabels
36
37 contentItem: Private.IconLabel {
38 mirrored: control.mirrored
39 font: control.font
40 alignment: Qt.AlignLeft
41 display: control.display
42 spacing: control.spacing
43 iconItem.implicitWidth: control.icon.width
44 iconItem.implicitHeight: control.icon.height
45 iconItem.source: control.icon.name || control.icon.source
46 label.text: control.text
47 }
48
49 background: Private.DefaultListItemBackground {
50 control: control
51 }
52}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:34:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.