8import QtQuick.Layouts 1.15
9import QtQuick.Controls 2.15 as QQC2
10import QtQuick.Templates 2.15 as T
11import org.kde.kirigami 2.20 as Kirigami
48 Kirigami.Theme.colorSet: Kirigami.Theme.Button
49 Kirigami.Theme.inherit: false
51 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
52 implicitContentWidth + leftPadding + rightPadding)
53 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
54 implicitContentHeight + topPadding + bottomPadding)
56 readonly property size __effectiveIconSize: Qt.size(
57 icon.height > 0 ? icon.height : Kirigami.Units.iconSizes.medium,
58 icon.width > 0 ? icon.width : Kirigami.Units.iconSizes.medium,
62 readonly property real __padding: radius === Infinity
63 ? Math.round(Math.max(__effectiveIconSize.width, __effectiveIconSize.height) * (Math.sqrt(2) - 1))
64 : Kirigami.Settings.hasTransientTouchInput ? (Kirigami.Units.largeSpacing * 2) : Kirigami.Units.largeSpacing
67 property real margins: 0
68 property real topMargin: margins
69 property real leftMargin: margins
70 property real rightMargin: margins
71 property real bottomMargin: margins
76 topPadding: padding + topMargin
77 leftPadding: padding + leftMargin
78 rightPadding: padding + rightMargin
79 bottomPadding: padding + bottomMargin
84 rightInset: rightMargin
85 bottomInset: bottomMargin
88 radius: Kirigami.Units.cornerRadius
93 hoverEnabled: !Kirigami.Settings.hasTransientTouchInput
96 implicitWidth: controlRoot.__effectiveIconSize.width
97 implicitHeight: controlRoot.__effectiveIconSize.height
101 color: controlRoot.icon.color
102 source: controlRoot.icon.name !== "" ? controlRoot.icon.name : controlRoot.icon.source
107 Kirigami.ShadowedRectangle {
108 anchors.centerIn: parent
109 width: Math.min(parent.width, parent.height)
111 radius: controlRoot.radius
117 color: Qt.rgba(0, 0, 0, 0.2)
122 color: if (controlRoot.down || controlRoot.visualFocus) {
123 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.4)
124 } else if (controlRoot.enabled && controlRoot.hovered) {
125 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.6)
127 Kirigami.ColorUtils.linearInterpolation(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, Kirigami.Theme.frameContrast)
131 color: if (controlRoot.down || controlRoot.visualFocus) {
132 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.6)
133 } else if (controlRoot.enabled && controlRoot.hovered) {
134 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.hoverColor, Kirigami.Theme.backgroundColor, 0.8)
136 Kirigami.Theme.backgroundColor
139 Behavior on border.color {
141 duration: Kirigami.Units.veryShortDuration
147 duration: Kirigami.Units.veryShortDuration