widget: fix opacity not working when passed in a constructor. closes #734

This commit is contained in:
Mathieu Virbel 2012-10-29 01:56:26 +01:00
parent fc9e819b24
commit fb12e1579c
1 changed files with 4 additions and 2 deletions

View File

@ -141,7 +141,7 @@ class Widget(EventDispatcher):
# Create the default canvas if not exist
if self.canvas is None:
self.canvas = Canvas()
self.canvas = Canvas(opacity=self.opacity)
# Apply all the styles
if '__no_builder' not in kwargs:
@ -586,7 +586,9 @@ class Widget(EventDispatcher):
'''
def on_opacity(self, instance, value):
self.canvas.opacity = value
canvas = self.canvas
if canvas is not None:
canvas.opacity = value
canvas = None
'''Canvas of the widget.