Closed HollyCeuin closed 1 year ago
This is how the bug looks (it's going off-screen)
This is how it's supposed to look, and does once charged to a point out of the bug's range
The code used for the battery % indicator (from the Library theme but this occurs in any theme that displays a battery percentage)
Text {
/* Lists the battery, not much more.
*/
id: battery
width: contentWidth
height: parent.height
anchors.left: currentTime.left
anchors.leftMargin: currentTime.contentWidth + parent.width * 0.74
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
text: isNaN(api.device.batteryPercent) ? "" : api.device.batteryPercent.toFixed(2)*100 + "%"
color: colors["text"]
font.family: gilroyExtraBold.name
font.pixelSize: height / 2
}
fixed by changing text to
isNaN(api.device.batteryPercent) ? "" : Math.round(api.device.batteryPercent*100) + "%"
The issue
Using the battery percentage api, if the battery percentage drops below around 59%, it will become 59.xxxxxxxxxxxxx%. This only seems to occur between 50 and 60 percent, give or take 1/2.
System info
Android 10, AYN Odin Pro (SD845)
Pegasus version
alpha16-50-g4996c0e8, 2023-05-10
Pegasus log
attached lastrun.log