/** SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>** SPDX-License-Identifier: GPL-2.0-or-later*/import QtQuick 2.15import QtQuick.Controls 2.15 as QQC2import QtQuick.Layouts 1.13import org.kde.plasma.plasmoid 2.0import org.kde.plasma.core as PlasmaCoreimport org.kde.kirigami 2.20 as Kirigamiimport org.kde.kcmutils as KCMKCM.SimpleKCM {property bool cfg_showText: Plasmoid.configuration.showTextKirigami.FormLayout {anchors.right: parent.rightanchors.left: parent.leftQQC2.CheckBox {id: showTextCheckboxenabled: Plasmoid.formFactor === PlasmaCore.Types.Horizontaltext: i18n("Show active application's name on Panel button")// We do manual state handling rather than making cfg_showText an// alias property because we want to force the checkbox to look// unchecked when it's disabled, regardless of its actual underlying// state.checked: enabled ? cfg_showText : falseonToggled: cfg_showText = checked}QQC2.Label {Layout.fillWidth: true// Arbitrary maximum length to make it wrap earlier, because long// unwrapped text is ugly and harder to read.Layout.maximumWidth: Kirigami.Units.gridUnit * 25visible: !showTextCheckbox.enabledtext: Plasmoid.formFactor === PlasmaCore.Types.Vertical ?// On a vertical paneli18n("Only icons can be shown when the Panel is vertical.") :// On the desktopi18n("Not applicable when the widget is on the Desktop.")textFormat: Text.PlainTextwrapMode: Text.Wrapfont: Kirigami.Theme.smallFont}}}