Warning, /plasma/plasma-mobile/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2021 Devin Lin <espidev@gmail.com>
0003  *  SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 import QtQuick 2.6
0009 import QtQuick.Layouts 1.4
0010 
0011 import org.kde.kirigami 2.20 as Kirigami
0012 
0013 import org.kde.plasma.components 3.0 as PlasmaComponents
0014 import org.kde.plasma.workspace.components 2.0 as PW
0015 import org.kde.plasma.private.mobileshell as MobileShell
0016 
0017 RowLayout {
0018     property real textPixelSize: Kirigami.Units.gridUnit * 0.6
0019     
0020     visible: MobileShell.BatteryInfo.isVisible
0021 
0022     PW.BatteryIcon {
0023         id: battery
0024         Layout.preferredWidth: height
0025         Layout.fillHeight: true
0026         hasBattery: true
0027         percent: MobileShell.BatteryInfo.percent
0028         pluggedIn: MobileShell.BatteryInfo.pluggedIn
0029 
0030         height: batteryLabel.height
0031         width: batteryLabel.height
0032     }
0033 
0034     PlasmaComponents.Label {
0035         id: batteryLabel
0036         text: i18n("%1%", MobileShell.BatteryInfo.percent)
0037         Layout.alignment: Qt.AlignVCenter
0038 
0039         color: Kirigami.Theme.textColor
0040         font.pixelSize: textPixelSize
0041     }
0042 }