ProgressBar in Lockscreen
EDIT:
I uploaded the patch on openrepos, feel free to make suggestions and report bugs :)
https://openrepos.net/content/billyhalley/patch-battery-statusbar-lockscreen
Hi, i'm trying to implement a ProgressBar in the Lockscreen to show Battery charge.
i managed to obtain something funcional with this piece of code:
ProgressBar {
id: batteryProgressBar
anchors {
left: parent.left
bottom: parent.bottom
}
width: Screen.width
minimumValue: 0
maximumValue: 100
value: batteryChargePercentageContextProperty.value
label: batteryChargePercentageContextProperty.value
}
The problem is that i want it to change color like other items in Low Power Mode, other items use this line to adapt to LPM
color: lockScreen.textColor
but i don't know how to change colors of this progressbar
Instead i tried to implement it like this: https://github.com/dm8tbr/sailfishsilica-qt5/blob/master/usr/lib/qt5/qml/Sailfish/Silica/ProgressBar.qml
In this way i can set the colors to behave properly in LPM, but i can't get it to display the right value and the status "indeterminate"
I'm just a beginner with programming, so i need some help, i hope this is the right place
I am a beginner as well and can only offer this possible snippet of info, which may help, the following is not a suggestion but an idea of how the command may look (just guessing, based on my limited experience of building ambience).
Perhaps something like this -
color: Theme.primaryColor
orcolor: Theme.highlightColor
(where 'primary' affects time colour and 'highlight' affects operator/date/day/year), this applies when making ambience, so I figured it may be the same or similar parameters you need to set.Regards,
Spam Hunter ( 2015-01-24 18:33:05 +0200 )editThe problem is that progressbar does not have a color property, but the color is set inside a private property i guess, which i don't know how to find
ZioBilly ( 2015-01-24 19:00:08 +0200 )editInteresting thread, hope u get it sorted out. Could u share how do you get something like ProgressBar or any QML-component/element to be shown in LockScreen / LPM-(glance)-screen from 3rd-party or user app. Is there a Harbour conpliant way of doing this or does this require editing system QML-files directly?
foss4ever ( 2015-01-25 01:58:04 +0200 )editWell i edited some qmls, and that is how most patches like the one in patchmanager works. Once you know how these files works you can do basically anything, is a bit risky to edit the lockscreen qml because it can cause the lockscreen to crash, it's advisable to keep a backup of the files you edit though.. As i said i'm a real beginner, so i basically look how things works and copy and paste something and see if it still works.
However i noticed that the "indeterminate" status of the progressbar doesn't work as expected, i think there is some problem with time on the lockscreen
ZioBilly ( 2015-01-25 13:13:35 +0200 )editHave you tried testing with the emulator coming together with the SDK? It would be less risky then.
lakutalo ( 2015-01-30 21:04:04 +0200 )edit