I've come across this bug while cleaning up HippoCanvas usage from the
Chat activity code I'm using for the embeddable chat. This bug causes
CanvasRoundBox to ignore the border_color parameter passed to its
constructor and set it always to COLOR_BLACK.
From http://dev.laptop.org/ticket/3742
Replying to morgs <http://dev.laptop.org/ticket/3742>:
| Passing border_color to init doesn't work as it is overridden to
COLOR_BLACK, so I have to set it separately
This is solved by not overriding border_color in CanvasRoundBox when one
is provided. I believe the attached patch fixes this bug.
diff --git a/src/sugar/graphics/roundbox.py b/src/sugar/graphics/roundbox.py
index 573344e..1faf9fe 100644
--- a/src/sugar/graphics/roundbox.py
+++ b/src/sugar/graphics/roundbox.py
@@ -26,7 +26,7 @@ class CanvasRoundBox(hippo.CanvasBox, hippo.CanvasItem):
_BORDER_DEFAULT = style.LINE_WIDTH
- def __init__(self, **kwargs):
+ def __init__(self, border_color=None, **kwargs):
hippo.CanvasBox.__init__(self, **kwargs)
# TODO: we should calculate radius depending on the height of the box.
@@ -36,7 +36,8 @@ class CanvasRoundBox(hippo.CanvasBox, hippo.CanvasItem):
self.props.border = self._BORDER_DEFAULT
self.props.border_left = self._radius
self.props.border_right = self._radius
- self.props.border_color = style.COLOR_BLACK.get_int()
+ if not border_color:
+ self.props.border_color = style.COLOR_BLACK.get_int()
def do_paint_background(self, cr, damaged_box):
[width, height] = self.get_allocation()
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar