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
|
|
|
|
|
|
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
|
|
|
|
import org.kde.plasma.workspace.components 2.0 as PW
|
2021-12-22 23:29:00 +00:00
|
|
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
2019-10-07 16:49:18 +00:00
|
|
|
|
|
|
|
|
RowLayout {
|
2021-12-22 23:29:00 +00:00
|
|
|
property MobileShell.BatteryProvider provider: MobileShell.BatteryProvider
|
|
|
|
|
property real textPixelSize: PlasmaCore.Units.gridUnit * 0.6
|
2021-04-09 20:59:05 +00:00
|
|
|
visible: provider.isVisible
|
2019-10-07 16:49:18 +00:00
|
|
|
|
|
|
|
|
PW.BatteryIcon {
|
|
|
|
|
id: battery
|
|
|
|
|
Layout.preferredWidth: height
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
hasBattery: true
|
2021-04-09 20:59:05 +00:00
|
|
|
percent: provider.percent
|
|
|
|
|
pluggedIn: provider.pluggedIn
|
2019-10-07 16:49:18 +00:00
|
|
|
|
|
|
|
|
height: batteryLabel.height
|
|
|
|
|
width: batteryLabel.height
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlasmaComponents.Label {
|
|
|
|
|
id: batteryLabel
|
2021-04-09 20:59:05 +00:00
|
|
|
text: i18n("%1%", provider.percent)
|
2019-10-07 16:49:18 +00:00
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
|
|
|
|
|
|
color: PlasmaCore.ColorScope.textColor
|
2021-12-22 23:29:00 +00:00
|
|
|
font.pixelSize: textPixelSize
|
2019-10-07 16:49:18 +00:00
|
|
|
}
|
|
|
|
|
}
|