Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Dengler <martin@martindengler.com>2008-07-14 11:31:05 (GMT)
committer Martin Dengler <martin@martindengler.com>2008-07-14 15:01:11 (GMT)
commit6a41396dd2ee5ca66d6cb64a3f592892f6f60492 (patch)
tree015e0a6acc0875d63f3a8f6a5ba14c237a456666 /src
parent1659332c81ffaaf660852837c031c0da65ac1cf9 (diff)
#4208 get_icon_state accepts negative step kwarg
Diffstat (limited to 'src')
-rw-r--r--src/sugar/graphics/icon.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py
index 24b5ca5..f99eade 100644
--- a/src/sugar/graphics/icon.py
+++ b/src/sugar/graphics/icon.py
@@ -581,11 +581,10 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
palette = property(get_palette, set_palette)
def get_icon_state(base_name, perc, step=5):
- assert step > 0, 'get_icon_state(): step must be positive\n'
strength = round(perc / step) * step
icon_theme = gtk.icon_theme_get_default()
- while strength <= 100:
+ while strength <= 100 and strength >= 0:
icon_name = '%s-%03d' % (base_name, strength)
if icon_theme.has_icon(icon_name):
return icon_name