2021-04-09 20:59:05 +00:00
|
|
|
/*
|
2021-12-22 23:29:00 +00:00
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
2021-04-09 20:59:05 +00:00
|
|
|
* SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2023-10-19 17:41:29 +00:00
|
|
|
pragma Singleton
|
|
|
|
|
|
2023-03-16 07:21:01 +00:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
2021-04-09 20:59:05 +00:00
|
|
|
|
2023-03-16 07:21:01 +00:00
|
|
|
import org.kde.plasma.plasma5support as P5Support
|
|
|
|
|
import org.kde.plasma.workspace.components as PW
|
2021-04-09 20:59:05 +00:00
|
|
|
|
2023-03-16 07:21:01 +00:00
|
|
|
QtObject {
|
2021-04-09 20:59:05 +00:00
|
|
|
property bool isVisible: pmSource.data["Battery"]["Has Cumulative"]
|
|
|
|
|
property int percent: pmSource.data["Battery"]["Percent"]
|
|
|
|
|
property bool pluggedIn: pmSource.data["AC Adapter"] ? pmSource.data["AC Adapter"]["Plugged in"] : false
|
|
|
|
|
|
2023-03-08 13:26:36 +00:00
|
|
|
property P5Support.DataSource pmSource: P5Support.DataSource {
|
2021-04-09 20:59:05 +00:00
|
|
|
engine: "powermanagement"
|
|
|
|
|
connectedSources: ["Battery", "AC Adapter"]
|
|
|
|
|
}
|
|
|
|
|
}
|