diff --git a/org.kde.desktop/RadioButton.qml b/org.kde.desktop/RadioButton.qml index 2fd49aa..50947ca 100644 --- a/org.kde.desktop/RadioButton.qml +++ b/org.kde.desktop/RadioButton.qml @@ -1,78 +1,78 @@ /* * Copyright 2017 Marco Martin * Copyright 2017 The Qt Company Ltd. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 3 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPLv3 included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 3 requirements * will be met: https://www.gnu.org/licenses/lgpl.html. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 2.0 or later as published by the Free * Software Foundation and appearing in the file LICENSE.GPL included in * the packaging of this file. Please review the following information to * ensure the GNU General Public License version 2.0 requirements will be * met: http://www.gnu.org/licenses/gpl-2.0.html. */ import QtQuick 2.6 import QtQuick.Templates @QQC2_VERSION@ as T import QtQuick.Controls @QQC2_VERSION@ import org.kde.kirigami 2.3 as Kirigami import "private" T.RadioButton { - id: control + id: controlRoot implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, Math.max(contentItem.implicitHeight, indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) baselineOffset: contentItem.y + contentItem.baselineOffset padding: 1 hoverEnabled: true indicator: RadioIndicator { - LayoutMirroring.enabled: control.mirrored + LayoutMirroring.enabled: controlRoot.mirrored LayoutMirroring.childrenInherit: true anchors { left: parent.left verticalCenter: parent.verticalCenter } - control: control + control: controlRoot } - Kirigami.MnemonicData.enabled: control.enabled && control.visible + Kirigami.MnemonicData.enabled: controlRoot.enabled && controlRoot.visible Kirigami.MnemonicData.controlType: Kirigami.MnemonicData.ActionElement - Kirigami.MnemonicData.label: control.text + Kirigami.MnemonicData.label: controlRoot.text Shortcut { //in case of explicit & the button manages it by itself - enabled: !(RegExp(/\&[^\&]/).test(control.text)) - sequence: control.Kirigami.MnemonicData.sequence - onActivated: control.checked = true + enabled: !(RegExp(/\&[^\&]/).test(controlRoot.text)) + sequence: controlRoot.Kirigami.MnemonicData.sequence + onActivated: controlRoot.checked = true } + contentItem: Label { - leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 - opacity: control.enabled ? 1 : 0.6 - text: control.Kirigami.MnemonicData.richTextLabel - font: control.font - color: Kirigami.Theme.textColor + leftPadding: controlRoot.indicator && !controlRoot.mirrored ? controlRoot.indicator.width + controlRoot.spacing : 0 + rightPadding: controlRoot.indicator && controlRoot.mirrored ? controlRoot.indicator.width + controlRoot.spacing : 0 + opacity: controlRoot.enabled ? 1 : 0.6 + text: controlRoot.Kirigami.MnemonicData.richTextLabel + font: controlRoot.font elide: Text.ElideRight - visible: control.text + visible: controlRoot.text horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter FocusRect { control: controlRoot } } }