#8661 NORM 9.1.0: sugar.graphics.Icon should support setting pixbufs
Zarro Boogs per Child
bugtracker at laptop.org
Wed Nov 5 06:32:36 EST 2008
#8661: sugar.graphics.Icon should support setting pixbufs
-------------------------------------+--------------------------------------
Reporter: sayamindu | Owner: marco
Type: enhancement | Status: new
Priority: normal | Milestone: 9.1.0
Component: sugar-toolkit | Version: Git as of bug date
Resolution: | Keywords: r-
Next_action: review | Verified: 0
Deployment_affected: | Blockedby:
Blocking: |
-------------------------------------+--------------------------------------
Changes (by marco):
* keywords: r? => r-
Comment:
{{{
+ if icon_info.file_name is None and self.pixbuf is None: # Sanity
check
+ return
}}}
Code is self explanatory there, I'd remove the comment.
{{{
+ if self.pixbuf is None:
+ self.pixbuf =
gtk.gdk.pixbuf_new_from_file(icon_info.file_name)
}}}
Here and below, changing the class state in get_surface looks wrong. Do
you see any problem in just keeping self.pixbuf as is, and use the local
pixbuf variable for everything you are doing there?
{{{
+ def set_pixbuf(self, pixbuf):
+ self._buffer.pixbuf = pixbuf
+ self.queue_draw()
}}}
We should expose it as gproperty. Also while you are it would be good to
add the same property to CanvasIcon (should be trivial).
--
Ticket URL: <http://dev.laptop.org/ticket/8661#comment:2>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list