[packages/kde4-kdebase-workspace] - animated battery icon for < 5%

arekm arekm at pld-linux.org
Thu Jun 6 22:57:33 CEST 2013


commit 1d656c41afc85185962c46cf0094daca4db4b1a2
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Jun 6 22:57:27 2013 +0200

    - animated battery icon for < 5%

 kde4-kdebase-workspace-multibattery.patch | 133 ++++++++++++++++++++++++++++++
 1 file changed, 133 insertions(+)
---
diff --git a/kde4-kdebase-workspace-multibattery.patch b/kde4-kdebase-workspace-multibattery.patch
index 9865c51..970fb96 100644
--- a/kde4-kdebase-workspace-multibattery.patch
+++ b/kde4-kdebase-workspace-multibattery.patch
@@ -2254,3 +2254,136 @@ index 357c2dc..feda7bc 100644
          }
  
          property int cumulativePercent
+diff --git a/plasma/generic/applets/batterymonitor/contents/ui/AcAdapterItem.qml b/plasma/generic/applets/batterymonitor/contents/ui/AcAdapterItem.qml
+deleted file mode 100644
+index c2216f8..0000000
+--- a/plasma/generic/applets/batterymonitor/contents/ui/AcAdapterItem.qml
++++ /dev/null
+@@ -1,87 +0,0 @@
+-/*
+- *   Copyright 2012-2013 Daniel Nicoletti <dantti12 at gmail.com>
+- *   Copyright 2013 Kai Uwe Broulik <kde at privat.broulik.de>
+- *
+- *   This program is free software; you can redistribute it and/or modify
+- *   it under the terms of the GNU Library General Public License as
+- *   published by the Free Software Foundation; either version 2 or
+- *   (at your option) any later version.
+- *
+- *   This program is distributed in the hope that it will be useful,
+- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- *   GNU General Public License for more details
+- *
+- *   You should have received a copy of the GNU Library General Public
+- *   License along with this program; if not, write to the
+- *   Free Software Foundation, Inc.,
+- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+- */
+-
+-import QtQuick 1.1
+-import org.kde.plasma.core 0.1 as PlasmaCore
+-import org.kde.plasma.components 0.1 as Components
+-import org.kde.qtextracomponents 0.1
+-
+-Item {
+-    id: brightnessItem
+-    clip: true
+-    width: parent.width
+-    height: acIcon.height + padding.margins.top + padding.margins.bottom
+-
+-    property bool pluggedIn
+-    property bool showTime
+-    property string remainingString
+-
+-    QIconItem {
+-        id: acIcon
+-        width: theme.iconSizes.dialog
+-        height: width
+-        anchors {
+-            top: parent.top
+-            topMargin: padding.margins.top
+-            left: parent.left
+-            leftMargin: padding.margins.left
+-        }
+-
+-        icon: pluggedIn ? QIcon("battery-charging-low") : QIcon("battery-low")
+-    }
+-
+-    Components.Label {
+-        id: acLabel
+-        anchors {
+-            top: acIcon.top
+-            left: acIcon.right
+-            leftMargin: 6
+-        }
+-        height: paintedHeight
+-        text: i18n("AC Adapter")
+-    }
+-
+-    Components.Label {
+-        id: acStatus
+-        anchors {
+-            top: showTime ? acLabel.top : undefined
+-            bottom: showTime ? undefined : acIcon.bottom
+-            left: showTime ? acLabel.right : acIcon.right
+-            leftMargin: showTime ? 3 : 6
+-        }
+-        height: paintedHeight
+-        text: pluggedIn ? i18n("Plugged In") : i18n("Not Plugged In")
+-        color: "#77"+(theme.textColor.toString().substr(1))
+-    }
+-
+-    Components.Label {
+-        id: acTime
+-        anchors {
+-            bottom: acIcon.bottom
+-            left: acIcon.right
+-            leftMargin: 6
+-        }
+-        height: paintedHeight
+-        visible: showTime
+-        text: pluggedIn ? i18n("Time remaining until full: %1", remainingString) : i18n("Time remaining until empty: %1", remainingString)
+-        color: "#77"+(theme.textColor.toString().substr(1))
+-    }
+-}
+-
+diff --git a/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml b/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml
+index 106c8f9..cdb2a35 100644
+--- a/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml
++++ b/plasma/generic/applets/batterymonitor/contents/ui/BatteryIcon.qml
+@@ -32,11 +32,35 @@ Item {
+     }
+ 
+     PlasmaCore.SvgItem {
++        id: batterySvg
+         anchors.fill: parent
+         svg: svg
+         elementId: "Battery"
+     }
+ 
++    SequentialAnimation {
++      running: percent < 5 && !pluggedIn
++      alwaysRunToEnd: true
++      loops: Animation.Infinite
++
++      NumberAnimation {
++          target: batterySvg
++          properties: "opacity"
++          from: 1.0
++          to: 0.2
++          duration: 750
++          easing.type: Easing.InCubic
++      }
++      NumberAnimation {
++          target: batterySvg
++          properties: "opacity"
++          from: 0.2
++          to: 1.0
++          duration: 750
++          easing.type: Easing.OutCubic
++      }
++    }
++
+     PlasmaCore.SvgItem {
+         id: fillSvg
+         anchors.fill: parent
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kde4-kdebase-workspace.git/commitdiff/1d656c41afc85185962c46cf0094daca4db4b1a2



More information about the pld-cvs-commit mailing list