1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 import pgm
18 from pgm.graph.text import Text
19 from dock import Dock
20
22
23 - def __init__(self, canvas, layer, template,
24 width, height, background_image):
25
26 Dock.__init__(self, canvas, layer, width, height, background_image)
27
28 self._template = template
29 self._volume_value = 0
30
31 inner_width = width * 0.95
32 inner_height = height * 0.45
33 inner_x = (width - inner_width) / 2.0
34 inner_y = (height - inner_height) / 2.0
35
36 self._volume = Text()
37 self._volume.label = ""
38 self._volume.ellipsize = pgm.TEXT_ELLIPSIZE_END
39 self._volume.fg_color = (220, 220, 220, 255)
40 self._volume.bg_color = (0, 0, 0, 0)
41 self.add(self._volume)
42 self._volume.position = (inner_x, inner_y, 0.0)
43 self._volume.size = (inner_width, inner_height)
44 self._volume.font_height = self._volume.height
45
46 self._volume.visible = True
47
51
53 return self._volume_value
54