2
# -*- coding: utf-8 -*-
6
__authors__ = ["Jan Jokela <janjokela@gmail.com>"]
7
__licenses__ = ["LICENSE.LGPL"]
8
__description__ = "Toolbar widget"
13
from container import Container
14
from image import Image
16
class Toolbar(Container):
18
A toolbar widget offers an overlay container for displaying tools and
19
should be placed over the actual content the tools refer to.
21
An example for this are overlay controls in a playing video.
26
""" Initialize toolbar widget """
28
super(Toolbar, self).__init__()
32
self._update_style(self.style)
34
def _init_elements(self):
35
""" Initializes graphical elements """
37
self._background_image = Image()
38
self.add(self._background_image)
40
def _update_style(self, props=None):
43
super(Toolbar, self)._update_style(props)
45
for key, value in props:
46
if key == 'background-image':
47
self.background_image = value
48
self._background_image.set_source(self.background_image)
49
self._background_image._update_layout()
51
def _update_layout(self):
52
""" Updates layout """
54
super(Toolbar, self)._update_layout()
56
for child in self.get_children():
57
child._update_layout()
59
# def add(self, child):
60
# """ Overrides clutter.Actor--add(child) method; calls layout update """
62
# super(Toolbar, self).add(child)
64
# self._update_layout()