[sugar] [PATCH] get_icon_name(): add step kwarg
Martin Dengler
martin at martindengler.com
Mon Jun 23 09:08:45 EDT 2008
On Mon, Jun 23, 2008 at 01:33:38PM +0200, Marco Pesenti Gritti wrote:
> r+, please add a \n after the assert.
Thanks -- amended patch at the end...I am not a commiter to
sugar-toolkit, in case you thought I could push the patch. If someone
wants they can pull from my sugar-toolkit repo at somewhere related to
http://dev.laptop.org/git?p=users/mdengler/sugar-toolkit;a=summary .
> (thanks for drawing attention on this again, and sorry for the delay)
Thank *you*.
> Marco
Martin
From 762ad00777e37324b76941ce07b34dec64d54566 Mon Sep 17 00:00:00 2001
From: Martin Dengler <martin at martindengler.com>
Date: Mon, 23 Jun 2008 12:58:46 +0100
Subject: [PATCH] get_icon_name() now takes step kwarg for #7248.1
---
src/sugar/graphics/icon.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py
index d22b412..24b5ca5 100644
--- a/src/sugar/graphics/icon.py
+++ b/src/sugar/graphics/icon.py
@@ -580,8 +580,8 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
palette = property(get_palette, set_palette)
-def get_icon_state(base_name, perc):
- step = 5
+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()
--
1.5.5.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080623/bc5dd8a7/attachment.pgp
More information about the Sugar
mailing list