@@ -32,7 +32,7 @@ class ProgressBarBase(displayio.TileGrid):
32
32
:type position: Tuple[int, int]
33
33
:param size: The size (width, height) of the progress bar
34
34
:type size: Tuple[int, int]
35
- :param start_value: The beginning value of the progress bar. This value
35
+ :param start_value: The beginning value of the progress bar. This value
36
36
is displayed when the progress bar is first visible,
37
37
if it hasn't been updated.
38
38
:type start_value: float
@@ -139,6 +139,7 @@ def progress(self):
139
139
140
140
@property
141
141
def border_thickness (self ):
142
+ """Gets the currently configured thickness of the border (in pixels)"""
142
143
return self ._border_thickness
143
144
144
145
@progress .setter
@@ -149,10 +150,10 @@ def progress(self, value):
149
150
bar. Must be between 0.0-1.0
150
151
"""
151
152
_old_value = self ._progress
152
- # If we're using floats, from 0.0 to 1.0, using 4 decimal places allows us to handle values as
153
- # precise as 0.23456, which evaluates to a percentage value of 23.45% (with rounding)
153
+ # If we're using floats, from 0.0 to 1.0, using 4 decimal places allows us to handle values
154
+ # as precise as 0.23456, which evaluates to a percentage value of 23.45% (with rounding)
154
155
self ._progress = round (value , 4 )
155
- self .render (_old_value , self .progress )
156
+ self .render (_old_value , self .progress , self . progress )
156
157
157
158
@property
158
159
def range (self ):
@@ -184,16 +185,21 @@ def _draw_outline(self):
184
185
self ._bitmap [line , _h ] = 1
185
186
self ._bitmap [self .width - 1 - line , _h ] = 1
186
187
187
- def render (self , _old_value , _new_value ) :
188
+ def render (self , _old_value , _new_value , _progress_value ) -> None :
188
189
"""The method called when the display needs to be updated. This method
189
190
can be overridden in child classes to handle the graphics appropriately.
190
191
191
- :param _old_value: float: The value from which we're updating
192
- :param _new_value: float: The value to which we're updating
193
-
192
+ :param _old_value: The value from which we're updating
193
+ :type _old_value: float
194
+ :param _new_value: The value to which we're updating
195
+ :type _new_value: float
196
+ :param _progress_value: The value of the progress, or ratio between the new value and the
197
+ maximum value
198
+ :type _progress_value: float
199
+ :rtype None:
194
200
"""
195
201
196
- def info ():
202
+ def info (self ):
197
203
"""This is the `info` method. It gives you info.
198
204
199
205
This information is usefull for debugging, and
0 commit comments