make config use json instead of shitty qt implementation
This commit is contained in:
parent
4e294cb377
commit
31965a0dba
40 changed files with 272 additions and 745 deletions
|
|
@ -14,10 +14,11 @@ BarComponent {
|
|||
property double percent: UPower.displayDevice.percentage * 100
|
||||
property bool hasBattery: UPower.displayDevice.isLaptopBattery
|
||||
property bool charging: UPower.displayDevice.state === UPowerDeviceState.Charging
|
||||
implicitHeight: Config.moduleHeight
|
||||
implicitWidth: batLayout.implicitWidth + 16
|
||||
|
||||
function batteryIcon(percent, charging) {
|
||||
function batteryIcon() {
|
||||
let charging = root.charging
|
||||
let percent = root.percent
|
||||
if(percent <= 10) return charging ? "battery-empty-charging" : "battery-empty"
|
||||
if(percent < 40) return charging ? "battery-level-30-charging" : "battery-level-30"
|
||||
if(percent < 50) return charging ? "battery-level-40-charging" : "battery-level-40"
|
||||
|
|
@ -32,16 +33,10 @@ BarComponent {
|
|||
RowLayout {
|
||||
id: batLayout
|
||||
anchors.centerIn: root
|
||||
IconImage {
|
||||
source: Quickshell.iconPath(root.batteryIcon(root.percent, root.charging) + "-symbolic")
|
||||
implicitSize: Config.iconSize
|
||||
layer.enabled: true
|
||||
layer.effect: MultiEffect {
|
||||
colorization: 1.0
|
||||
colorizationColor: Colors.text
|
||||
brightness: 0.5
|
||||
StyledIcon {
|
||||
iconName: root.batteryIcon()
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: Math.floor(root.percent,root.charging) + "%"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue