From e1abe6235723cbdbdfceb17de86075bf078f24e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Mon, 3 Oct 2011 17:31:35 +0100 Subject: Use battery-with-a-plug when the batttery is fully charged but still on AC Fixes https://bugs.launchpad.net/indicator-power/+bug/865342 --- src/indicator-power.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/indicator-power.c') 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); -- cgit v1.2.3