@@ -119,17 +119,17 @@ def progress(self, value):
119
119
if self ._progress_val > value :
120
120
# uncolorize range from width*value+margin to width-margin
121
121
# from right to left
122
- _prev_pixel = max (2 , int (self ._width * self ._progress_val - 2 ))
123
- _new_pixel = max (int (self ._width * value - 2 ), 2 )
122
+ _prev_pixel = max (2 , int (self .width * self ._progress_val - 2 ))
123
+ _new_pixel = max (int (self .width * value - 2 ), 2 )
124
124
for _w in range (_prev_pixel , _new_pixel - 1 , - 1 ):
125
- for _h in range (2 , self ._height - 2 ):
125
+ for _h in range (2 , self .height - 2 ):
126
126
self ._bitmap [_w , _h ] = 0
127
127
else :
128
128
# fill from the previous x pixel to the new x pixel
129
- _prev_pixel = max (2 , int (self ._width * self ._progress_val - 3 ))
130
- _new_pixel = min (int (self ._width * value - 2 ), int (self ._width * 1.0 - 3 ))
129
+ _prev_pixel = max (2 , int (self .width * self ._progress_val - 3 ))
130
+ _new_pixel = min (int (self .width * value - 2 ), int (self .width * 1.0 - 3 ))
131
131
for _w in range (_prev_pixel , _new_pixel + 1 ):
132
- for _h in range (2 , self ._height - 2 ):
132
+ for _h in range (2 , self .height - 2 ):
133
133
self ._bitmap [_w , _h ] = 2
134
134
self ._progress_val = value
135
135
@@ -141,6 +141,20 @@ def fill(self):
141
141
"""
142
142
return self ._palette [0 ]
143
143
144
+ @property
145
+ def width (self ):
146
+ """The width of the progress bar. In pixels, includes the border.
147
+
148
+ """
149
+ return self ._width
150
+
151
+ @property
152
+ def height (self ):
153
+ """The height of the progress bar. In pixels, includes the border.
154
+
155
+ """
156
+ return self ._height
157
+
144
158
@fill .setter
145
159
def fill (self , color ):
146
160
"""Sets the fill of the progress bar. Can be a hex value for a color or ``None`` for
0 commit comments