Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-07-12 21:24:04 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-07-12 21:24:04 (GMT)
commitcd6786a14f6617e808bea3ebe70fe54d2d1df5fd (patch)
treee90da9c71cf65bfed94add3851e4ca55cf1058a0
parent1429092b4b38d7e7ef4ffe53d3692a433c637156 (diff)
setting proper cairo context for badge displayHEADmaster
-rw-r--r--src/sugar/graphics/icon.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py
index d7a7b65..50bfc78 100644
--- a/src/sugar/graphics/icon.py
+++ b/src/sugar/graphics/icon.py
@@ -1,4 +1,5 @@
# Copyright (C) 2006-2007 Red Hat, Inc.
+# Copyright (C) 2011 Walter Bender
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -182,8 +183,9 @@ class _IconBuffer(object):
if not sensitive:
pixbuf = self._get_insensitive_pixbuf(pixbuf, widget)
- surface = pixbuf.cairo_create()
- context.set_source_surface(surface, 0, 0)
+
+ context = gtk.gdk.CairoContext(context)
+ context.set_source_pixbuf(pixbuf)
context.paint()
def _get_size(self, icon_width, icon_height, padding):
@@ -299,15 +301,14 @@ class _IconBuffer(object):
else:
pixbuf = handle.get_pixbuf()
pixbuf = self._get_insensitive_pixbuf(pixbuf, widget)
-
- pixbuf_surface = pixbuf.cairo_create()
- context.set_source_surface(pixbuf_surface, 0, 0)
+ context = gtk.gdk.CairoContext(context)
+ context.set_source_pixbuf(pixbuf)
context.paint()
else:
if not sensitive:
pixbuf = self._get_insensitive_pixbuf(pixbuf, widget)
- pixbuf_surface = pixbuf.cairo_create()
- context.set_source_surface(pixbuf_surface, 0, 0)
+ context = gtk.gdk.CairoContext(context)
+ context.set_source_pixbuf(pixbuf)
context.paint()
if self.badge_name:
@@ -546,7 +547,7 @@ class CanvasIcon(gtk.EventBox):
gtk.EventBox.__init__(self)
self.set_visible_window(False)
-
+
vbox = gtk.VBox()
self.add(vbox)
vbox.show()
@@ -665,7 +666,7 @@ class CanvasIcon(gtk.EventBox):
"""
if self._icon._buffer.icon_name != value:
self._icon._buffer.icon_name = value
- self.emit_paint_needed(0, 0, -1, -1)
+ self.do_expose_event(None)
def get_icon_name(self):
"""
@@ -962,7 +963,8 @@ class CanvasIcon(gtk.EventBox):
cr.set_source_surface(surface, x, y)
cr.paint()
- def do_get_content_width_request(self):
+ def get_width_request(self):
+ # def do_get_content_width_request(self):
"""
Parameters
----------
@@ -983,7 +985,8 @@ class CanvasIcon(gtk.EventBox):
return size, size
- def do_get_content_height_request(self, for_width):
+ def get_height_request(self, for_width):
+ # def do_get_content_height_request(self, for_width):
surface = self._icon._buffer.get_surface()
if surface:
size = surface.get_height()