Icons: Brightness and battery

This commit is contained in:
LemmyCook 2025-09-08 15:53:50 -04:00
parent 404a1d3e8b
commit ea6b8e0c02
18 changed files with 36 additions and 66 deletions

View file

@ -39,7 +39,7 @@ Item {
// Test mode
readonly property bool testMode: false
readonly property int testPercent: 50
readonly property bool testCharging: true
readonly property bool testCharging: false
// Main properties
readonly property var battery: UPower.displayDevice
@ -87,8 +87,7 @@ Item {
rightOpen: BarWidgetRegistry.getNPillDirection(root)
icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent,
charging, isReady)
iconRotation: -90
text: ((isReady && battery.isLaptopBattery) || testMode) ? Math.round(percent) + "%" : "-"
text: (isReady || testMode) ? Math.round(percent) + "%" : "-"
textColor: charging ? Color.mPrimary : Color.mOnSurface
iconCircleColor: Color.mPrimary
collapsedIconColor: Color.mOnSurface

View file

@ -46,8 +46,7 @@ Item {
function getIcon() {
var monitor = getMonitor()
var brightness = monitor ? monitor.brightness : 0
return brightness <= 0 ? "brightness_1" : brightness < 0.33 ? "brightness_low" : brightness
< 0.66 ? "brightness_medium" : "brightness_high"
return brightness <= 0.5 ? FontService.icons["brightness_low"] : FontService.icons["brightness_high"]
}
// Connection used to open the pill when brightness changes