quicksettings: use MarqueeLabel for quicksettings status label

This commit is contained in:
Yari Polla 2022-04-28 22:09:22 +02:00 committed by Devin Lin
parent 6ebbf71ca1
commit 8f1289139f

View file

@ -5,7 +5,7 @@
* SPDX-License-Identifier: LGPL-2.0-or-later * SPDX-License-Identifier: LGPL-2.0-or-later
*/ */
import QtQuick 2.1 import QtQuick 2.15
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.kirigami 2.12 as Kirigami import org.kde.kirigami 2.12 as Kirigami
@ -65,16 +65,18 @@ QuickSettingsDelegate {
Layout.fillWidth: true Layout.fillWidth: true
elide: Text.ElideRight elide: Text.ElideRight
text: root.text text: root.text
font.pixelSize: PlasmaCore.Theme.defaultFont.pixelSize * 0.8 // TODO base height off of size of delegate font.pointSize: PlasmaCore.Theme.defaultFont.pointSize * 0.8 // TODO base height off of size of delegate
font.weight: Font.Bold font.weight: Font.Bold
} }
PlasmaComponents.Label {
Layout.fillWidth: true Components.MarqueeLabel {
elide: Text.ElideRight
// if no status is given, just use On/Off // if no status is given, just use On/Off
text: root.status ? root.status : (root.enabled ? i18n("On") : i18n("Off")) inputText: status ? status : (enabled ? i18n("On") : i18n("Off"))
rightPadding: root.rightPadding
Layout.fillWidth: true
opacity: 0.6 opacity: 0.6
font.pixelSize: PlasmaCore.Theme.defaultFont.pixelSize * 0.8 font.pointSize: PlasmaCore.Theme.defaultFont.pointSize * 0.8
} }
} }
} }