@@ -50,6 +50,7 @@ class ProgressBarBase(displayio.TileGrid):
50
50
Default: 0x000000 (Black)
51
51
"""
52
52
53
+ # pylint: disable=too-many-arguments
53
54
def __init__ (
54
55
self ,
55
56
position : (int , int ),
@@ -69,7 +70,7 @@ def __init__(
69
70
self ._palette [1 ] = outline_color
70
71
self ._palette [2 ] = bar_color
71
72
72
- super (ProgressBarBase , self ).__init__ (
73
+ super ().__init__ (
73
74
self ._bitmap ,
74
75
pixel_shader = self ._palette ,
75
76
x = self ._position [0 ],
@@ -84,36 +85,34 @@ def __init__(
84
85
85
86
@property .getter
86
87
def width (self ):
87
- """The total width of the widget"""
88
+ """The total width of the widget, in pixels. Includes the border and margin. """
88
89
return self ._size [0 ]
89
90
90
91
@property .getter
91
92
def height (self ):
92
- """The total height of the widget"""
93
+ """The total height of the widget, in pixels. Includes the border and margin. """
93
94
return self ._size [1 ]
94
95
95
96
@property .getter
96
97
def x (self ):
97
- """The horizontal (x) position of the top-left corner of the widget"""
98
+ """The horizontal (x) position of the top-left corner of the widget. """
98
99
return self ._position [0 ]
99
100
100
101
@property .getter
101
102
def y (self ):
102
- """The vertical (y) position of the top-left corner of the widget"""
103
+ """The vertical (y) position of the top-left corner of the widget. """
103
104
return self ._position [1 ]
104
105
105
- @property
106
- def progress (self ):
107
- """The current displayed value of the widget"""
108
- return self ._progress
109
-
110
106
@property .setter
111
107
def progress (self , value ):
112
- """Sets/updates the displayed value"""
108
+ """The current displayed value of the widget.
109
+
110
+ :param float value: The new value which should be displayed by the progress
111
+ bar. Must be between 0.0-1.0
112
+ """
113
113
self ._progress = value
114
114
self .render ()
115
115
116
116
def render (self ):
117
117
"""The method called when the display needs to be updated. This method
118
118
can be overridden in child classes to handle the graphics appropriately."""
119
- pass
0 commit comments