/*SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>SPDX-License-Identifier: LGPL-2.0-only*/pragma ComponentBehavior: Boundimport QtQuickimport QtQuick.Controls as QQC2import QtQuick.Layoutsimport org.kde.kirigami as Kirigamiimport org.kde.plasma.core as PlasmaCoreQQC2.Button {id: buttonproperty string kcmId// We're using custom properties rather than plain old icon.name: and text:// because this would cause the icon and text to be rendered twice with// qqc2-desktop-style since it does all its rendering in the background item// rather than the contentItem like it should, so overriding the contentItem// as we're doing here doesn't completely replace those things as expected.property alias kcmIcon: iconItem.sourceproperty alias kcmName: label.textreadonly property PlasmaCore.Action kcmAction: kcm.kcmAction(kcmId)implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,implicitContentWidth + leftPadding + rightPadding)implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,implicitContentHeight + topPadding + bottomPadding)leftPadding: Kirigami.Units.largeSpacingrightPadding: Kirigami.Units.largeSpacingtopPadding: Kirigami.Units.largeSpacingbottomPadding: Kirigami.Units.largeSpacingspacing: Kirigami.Units.smallSpacingAccessible.name: label.textonClicked: {if (kcmAction) {kcmAction.trigger();}}contentItem: RowLayout {spacing: parent.spacingKirigami.Icon {id: iconItemLayout.alignment: Qt.AlignCenterimplicitWidth: Kirigami.Units.iconSizes.smallimplicitHeight: Kirigami.Units.iconSizes.smallsource: button.kcmAction?.icon ?? ""}QQC2.Label {id: labelLayout.fillWidth: trueelide: Text.ElideRighttextFormat: Text.PlainTexttext: button.kcmAction?.text ?? ""}}}