aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-10-03 17:31:35 +0100
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-10-03 17:31:35 +0100
commite1abe6235723cbdbdfceb17de86075bf078f24e5 (patch)
tree5d5fc7d5120b816a4a4a0880cea8244bb2a4453a /src
parent2d4b6f0d208efe4ce63299785cceac30228598c6 (diff)
downloadayatana-indicator-power-e1abe6235723cbdbdfceb17de86075bf078f24e5.tar.gz
ayatana-indicator-power-e1abe6235723cbdbdfceb17de86075bf078f24e5.tar.bz2
ayatana-indicator-power-e1abe6235723cbdbdfceb17de86075bf078f24e5.zip
Use battery-with-a-plug when the batttery is fully charged but still on AC
Fixes https://bugs.launchpad.net/indicator-power/+bug/865342
Diffstat (limited to 'src')
-rw-r--r--src/indicator-power.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 64392cd..8185397 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -368,7 +368,7 @@ get_device_icon (UpDeviceKind kind,
GIcon *gicon;
if (kind == UP_DEVICE_KIND_BATTERY &&
- state == UP_DEVICE_STATE_CHARGING)
+ (state == UP_DEVICE_STATE_CHARGING || state == UP_DEVICE_STATE_FULLY_CHARGED))
{
GString *filename;
gchar **iconnames;
@@ -376,9 +376,19 @@ get_device_icon (UpDeviceKind kind,
kind_str = up_device_kind_to_string (kind);
filename = g_string_new (NULL);
- g_string_append_printf (filename, "battery-caution-charging-symbolic;");
- g_string_append_printf (filename, "gpm-%s-000-charging;", kind_str);
- g_string_append_printf (filename, "battery-caution-charging;");
+
+ if (state == UP_DEVICE_STATE_CHARGING)
+ {
+ g_string_append_printf (filename, "battery-caution-charging-symbolic;");
+ g_string_append_printf (filename, "gpm-%s-000-charging;", kind_str);
+ g_string_append_printf (filename, "battery-caution-charging;");
+ }
+ else if (state == UP_DEVICE_STATE_FULLY_CHARGED)
+ {
+ g_string_append_printf (filename, "battery-full-charging-symbolic;");
+ g_string_append_printf (filename, "gpm-%s-100-charging;", kind_str);
+ g_string_append_printf (filename, "battery-full-charging;");
+ }
iconnames = g_strsplit (filename->str, ";", -1);
gicon = g_themed_icon_new_from_names (iconnames, -1);