aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-06-11 17:21:20 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-06-11 17:21:20 +0000
commitdefec1dd1db977f4e2643e977c0d5a1bbbd5f694 (patch)
tree62547cd7e910fe72c0dd2e4c61785b3526b82fa8
parent34ba55d3dfeffbe3882c00ae86d89ef4351367bb (diff)
parent8c874cb5a9f58ab9d1885dabb24e548afaa9b711 (diff)
downloadayatana-indicator-power-defec1dd1db977f4e2643e977c0d5a1bbbd5f694.tar.gz
ayatana-indicator-power-defec1dd1db977f4e2643e977c0d5a1bbbd5f694.tar.bz2
ayatana-indicator-power-defec1dd1db977f4e2643e977c0d5a1bbbd5f694.zip
Prefer the 'battery-XXX-charging' (eg, 'battery-020-charging') icons over the 'battery-low-charging' ones because the former are more precise and likely closer to the actual battery level. Fixes: 1186181
-rw-r--r--src/device.c3
-rw-r--r--tests/test-device.cc15
2 files changed, 12 insertions, 6 deletions
diff --git a/src/device.c b/src/device.c
index e3b655a..8780d72 100644
--- a/src/device.c
+++ b/src/device.c
@@ -416,8 +416,9 @@ indicator_power_device_get_icon_names (const IndicatorPowerDevice * device)
case UP_DEVICE_STATE_CHARGING:
suffix_str = get_device_icon_suffix (percentage);
index_str = get_device_icon_index (percentage);
- g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging-symbolic", kind_str, suffix_str));
+ g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging", kind_str, index_str));
g_ptr_array_add (names, g_strdup_printf ("gpm-%s-%s-charging", kind_str, index_str));
+ g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging-symbolic", kind_str, suffix_str));
g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging", kind_str, suffix_str));
break;
diff --git a/tests/test-device.cc b/tests/test-device.cc
index 96bea80..7d54816 100644
--- a/tests/test-device.cc
+++ b/tests/test-device.cc
@@ -324,8 +324,9 @@ TEST_F(DeviceTest, IconNames)
INDICATOR_POWER_DEVICE_PERCENTAGE, 95.0,
NULL);
- g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str);
+ g_string_append_printf (expected, "%s-100-charging;", kind_str);
g_string_append_printf (expected, "gpm-%s-100-charging;", kind_str);
+ g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str);
g_string_append_printf (expected, "%s-full-charging", kind_str);
check_icon_names (device, expected->str);
g_string_truncate (expected, 0);
@@ -335,8 +336,9 @@ TEST_F(DeviceTest, IconNames)
INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING,
INDICATOR_POWER_DEVICE_PERCENTAGE, 85.0,
NULL);
- g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str);
+ g_string_append_printf (expected, "%s-080-charging;", kind_str);
g_string_append_printf (expected, "gpm-%s-080-charging;", kind_str);
+ g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str);
g_string_append_printf (expected, "%s-full-charging", kind_str);
check_icon_names (device, expected->str);
g_string_truncate (expected, 0);
@@ -346,8 +348,9 @@ TEST_F(DeviceTest, IconNames)
INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING,
INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0,
NULL);
- g_string_append_printf (expected, "%s-good-charging-symbolic;", kind_str);
+ g_string_append_printf (expected, "%s-060-charging;", kind_str);
g_string_append_printf (expected, "gpm-%s-060-charging;", kind_str);
+ g_string_append_printf (expected, "%s-good-charging-symbolic;", kind_str);
g_string_append_printf (expected, "%s-good-charging", kind_str);
check_icon_names (device, expected->str);
g_string_truncate (expected, 0);
@@ -357,8 +360,9 @@ TEST_F(DeviceTest, IconNames)
INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING,
INDICATOR_POWER_DEVICE_PERCENTAGE, 25.0,
NULL);
- g_string_append_printf (expected, "%s-low-charging-symbolic;", kind_str);
+ g_string_append_printf (expected, "%s-020-charging;", kind_str);
g_string_append_printf (expected, "gpm-%s-020-charging;", kind_str);
+ g_string_append_printf (expected, "%s-low-charging-symbolic;", kind_str);
g_string_append_printf (expected, "%s-low-charging", kind_str);
check_icon_names (device, expected->str);
g_string_truncate (expected, 0);
@@ -368,8 +372,9 @@ TEST_F(DeviceTest, IconNames)
INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING,
INDICATOR_POWER_DEVICE_PERCENTAGE, 5.0,
NULL);
- g_string_append_printf (expected, "%s-caution-charging-symbolic;", kind_str);
+ g_string_append_printf (expected, "%s-000-charging;", kind_str);
g_string_append_printf (expected, "gpm-%s-000-charging;", kind_str);
+ g_string_append_printf (expected, "%s-caution-charging-symbolic;", kind_str);
g_string_append_printf (expected, "%s-caution-charging", kind_str);
check_icon_names (device, expected->str);
g_string_truncate (expected, 0);