[Differential] [Commented On] D3603: Option to show percentage charge in the icon

broulik (Kai Uwe Broulik) noreply at phabricator.kde.org
Mon Dec 5 20:23:34 UTC 2016


broulik added a comment.


  Nifty. That I haven't thought of that kind of placement before. I always wanted some crappy overlay like we had before.
  
  Can you please check again with opacity mask instead of just overlaying a Rectangle. Also, what's up with the Canvas thing?

INLINE COMMENTS

> main.xml:11
> +      <label>If true, the battery will display a little charge percentage label inside.</label>
> +      <default>false</default>
> +    </entry>

I think this could even be the default?

> CompactRepresentation.qml:72
>  
> -                    BatteryIcon {
> -                        id: batteryIcon
> -                        anchors.horizontalCenter: isConstrained ? undefined : parent.horizontalCenter
> -                        hasBattery: batteryContainer.hasBattery
> -                        percent: batteryContainer.percent
> -                        pluggedIn: batteryContainer.pluggedIn
> -                        height: isConstrained ? batteryContainer.iconSize : batteryContainer.iconSize - batteryLabel.height
> -                        width: height
> +                Rectangle {
> +                    anchors {

Can you instead try an OpacityMask / ShaderEffect thing like I did in task manager for the badge so we actually cut out a piece of the icon instead of just overlaying an opaque rectangle?

> CompactRepresentation.qml:84
>                          id: batteryLabel
> -                        width: parent.width
> -                        height: visible ? paintedHeight : 0
> +                        anchors.centerIn: parent
> +                        height: paintedHeight

for fonts avoid vertically anchoring it, use verticalAlignment instead to ensure descenders are properly taken into account

> CompactRepresentationCircle.qml:54
>                  property bool hasBattery: view.singleBattery ? view.hasBattery : model["Plugged in"]
> -                property int percent: view.singleBattery ? pmSource.data["Battery"]["Percent"] : model["Percent"]
> +                property int percent: 72//view.singleBattery ? pmSource.data["Battery"]["Percent"] : model["Percent"]
>                  property bool pluggedIn: pmSource.data["AC Adapter"] && pmSource.data["AC Adapter"]["Plugged in"] && (view.singleBattery || model["Is Power Supply"])

;)

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D3603

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: mart, #plasma
Cc: broulik, plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161205/adf21bc7/attachment.html>


More information about the Plasma-devel mailing list