We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2015-01-24 17:14:57 +0200

ProgressBar in 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

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

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