add charging indicator for statusIcons

This commit is contained in:
lucy 2026-01-16 15:15:44 +01:00
parent 051c1815b3
commit 32a385bfb7
9 changed files with 49 additions and 30 deletions

15
:w Normal file
View File

@ -0,0 +1,15 @@
import QtQuick
import "../settings/"
import "../"
Text {
property real fill
font.family: "Material Symbols Rounded"
color: Colors.foreground
font.pixelSize: Settings.config.fontSize + 2
font.variableAxes: {
wght: 700,
}
}

View File

@ -28,9 +28,7 @@ Variants {
property var screen: root.modelData
Layout.leftMargin: 10
}
Title {
anchors.verticalCenter: parent.verticalCenter
}
Title {}
}
Row {

View File

@ -19,11 +19,10 @@ Loader {
property bool frame4: UPower.displayDevice.percentage < 0.74
property bool frame5: UPower.displayDevice.percentage < 0.90
property bool frame6: UPower.displayDevice.percentage <= 1
property bool charging: UPower.displayDevice.Charging
function getBatteryIcon() {
if (charging) {
return "battery_android_frame_bolt"
if (UPower.displayDevice.state == UPowerDeviceState.Charging) {
return "battery_android_frame_bolt";
}
if (frame1) {
return "battery_android_frame_1";
@ -49,8 +48,8 @@ Loader {
implicitHeight: Settings.config.barHeight
Row {
anchors.centerIn: parent
id: batRow
anchors.verticalCenter: parent.verticalCenter
spacing: 5
CustomText {
id: batText
@ -60,7 +59,6 @@ Loader {
id: batIcon
text: root.getBatteryIcon()
}
}
}
}

View File

@ -7,7 +7,6 @@ Item {
id: root
implicitWidth: trayRow.implicitWidth
implicitHeight: Settings.config.barHeight
anchors.verticalCenter: parent.verticalCenter
Row {
id: trayRow

View File

@ -33,18 +33,20 @@ Item {
implicitWidth: textRow.implicitWidth + 10
implicitHeight: Settings.config.barHeight
Row {
id: textRow
anchors.centerIn: parent
spacing: 5
id: textRow
CustomText {
id: volumeText
PwObjectTracker {
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
}
text: Pipewire.ready ? Math.round(root.sink.audio.volume * 100) + "%" : "failure"
opacity: root.sink.audio.muted ? 0.5 : 1
}
CustomIcon {
id: volumeIcon
opacity: root.sink.audio.muted ? 0.5 : 1
text: root.getVolumeIcon()
}
}

View File

@ -7,5 +7,9 @@ Text {
font.family: "Material Symbols Rounded"
color: Colors.foreground
font.pixelSize: Settings.config.fontSize + 2
font.weight: 500
font.variableAxes: ({
FILL: fill.toFixed(1),
GRAD: 200,
wght: 400
})
}

View File

@ -3,8 +3,11 @@ import "../settings/"
import "../"
Text {
font.weight: 900
color: Colors.foreground
font.family: Settings.config.font
font.pixelSize: Settings.config.fontSize
font.variableAxes: ({
GRAD: 200,
wght: 400
})
}

View File

@ -23,8 +23,8 @@ Singleton {
id: settingsAdapter
property var currentWall: "/home/lucy/.walls/faris.jpg"
property var barHeight: 28
property var font: "JetBrainsMono Nerd Font"
property var fontSize: 12
property var font: "SauceCodePro Nerd Font Mono"
property var fontSize: 14
property var rounding: 10
property var wallDir: "/home/lucy/.walls"
property bool floating: true

View File

@ -2,8 +2,8 @@
"barHeight": 28,
"currentWall": "/home/lucy/.walls/faris.jpg",
"floating": true,
"font": "JetBrainsMono Nerd Font",
"fontSize": 12,
"font": "SauceCodePro Nerd Font Mono",
"fontSize": 14,
"paddingSides": 10,
"paddingTop": 10,
"rounding": 10,