2019-10-07 16:49:18 +00:00
|
|
|
/*
|
2021-04-09 20:59:05 +00:00
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <espidev@gmail.com>
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org>
|
2019-10-07 16:49:18 +00:00
|
|
|
*
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2019-10-07 16:49:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.6
|
|
|
|
|
import QtQuick.Layouts 1.4
|
|
|
|
|
|
2023-07-25 01:13:52 +00:00
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
|
|
|
|
|
2019-10-07 16:49:18 +00:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
|
|
|
|
import org.kde.plasma.workspace.components 2.0 as PW
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2023-03-17 02:44:36 +00:00
|
|
|
|
2019-10-07 16:49:18 +00:00
|
|
|
RowLayout {
|
2023-07-25 01:13:52 +00:00
|
|
|
property real textPixelSize: Kirigami.Units.gridUnit * 0.6
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2023-10-19 17:41:29 +00:00
|
|
|
visible: MobileShell.BatteryInfo.isVisible
|
2019-10-07 16:49:18 +00:00
|
|
|
|
|
|
|
|
PW.BatteryIcon {
|
|
|
|
|
id: battery
|
|
|
|
|
Layout.preferredWidth: height
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
hasBattery: true
|
2023-10-19 17:41:29 +00:00
|
|
|
percent: MobileShell.BatteryInfo.percent
|
|
|
|
|
pluggedIn: MobileShell.BatteryInfo.pluggedIn
|
2019-10-07 16:49:18 +00:00
|
|
|
|
|
|
|
|
height: batteryLabel.height
|
|
|
|
|
width: batteryLabel.height
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlasmaComponents.Label {
|
|
|
|
|
id: batteryLabel
|
2023-10-19 17:41:29 +00:00
|
|
|
text: i18n("%1%", MobileShell.BatteryInfo.percent)
|
2019-10-07 16:49:18 +00:00
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
|
|
2023-07-25 01:13:52 +00:00
|
|
|
color: Kirigami.Theme.textColor
|
2021-12-22 23:29:00 +00:00
|
|
|
font.pixelSize: textPixelSize
|
2019-10-07 16:49:18 +00:00
|
|
|
}
|
|
|
|
|
}
|