10import org.kde.kirigami as Kirigami
12import "private" as Private
48 default property alias delegates: internalColumn.data
60 property real maximumWidth:
Kirigami.Units.gridUnit * 30
67 property real padding: 0
68 property real verticalPadding: padding
69 property real horizontalPadding: padding
70 property real topPadding: verticalPadding
71 property real bottomPadding: verticalPadding
72 property real leftPadding: horizontalPadding
73 property real rightPadding: horizontalPadding
78 readonly
property bool cardWidthRestricted: root.width > root.maximumWidth
83 Layout.fillWidth:
true
85 implicitHeight: topPadding + bottomPadding + internalColumn.implicitHeight + rectangle.borderWidth * 2
90 readonly
property real borderWidth: 1
91 readonly
property bool isDarkColor: {
92 const temp =
Qt.darker(
Kirigami.Theme.backgroundColor, 1);
93 return temp.a > 0 && getDarkness(
Kirigami.Theme.backgroundColor) >= 0.4;
97 radius: root.cardWidthRestricted ?
Kirigami.Units.cornerRadius : 0
98 color:
Kirigami.Theme.backgroundColor
100 function getDarkness(background: color): real {
103 var temp =
Qt.darker(background, 1);
104 var a = 1 - ( 0.299 * temp.r + 0.587 * temp.g + 0.114 * temp.b);
110 bottom: parent.bottom
114 leftMargin: root.cardWidthRestricted ? Math.round((root.width - root.maximumWidth) / 2) : -1
115 rightMargin: root.cardWidthRestricted ? Math.round((root.width - root.maximumWidth) / 2) : -1
119 color: isDarkColor ?
Qt.darker(
Kirigami.Theme.backgroundColor, 1.2) :
Kirigami.ColorUtils.linearInterpolation(
Kirigami.Theme.backgroundColor,
Kirigami.Theme.textColor, 0.15)
124 size: isDarkColor ?
Kirigami.Units.smallSpacing :
Kirigami.Units.largeSpacing
125 color:
Qt.alpha(
Kirigami.Theme.textColor, 0.10)
132 readonly
property bool _roundCorners: root.cardWidthRestricted
139 leftMargin: root.leftPadding + rectangle.borderWidth
140 rightMargin: root.rightPadding + rectangle.borderWidth
141 topMargin: root.topPadding + rectangle.borderWidth
142 bottomMargin: root.bottomPadding + rectangle.borderWidth
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:46:08 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.