Skip to content

Commit 6853d73

Browse files
committed
make width and height properties without setters.
1 parent 112fa12 commit 6853d73

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

adafruit_progressbar.py

+16-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def __init__(
8080
self._palette[1] = outline_color
8181
self._palette[2] = bar_color
8282

83-
self.width = width
84-
self.height = height
83+
self._width = width
84+
self._height = height
8585

8686
self._progress_val = 0.0
8787
self.progress = self._progress_val
@@ -141,6 +141,20 @@ def fill(self):
141141
"""
142142
return self._palette[0]
143143

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+
144158
@fill.setter
145159
def fill(self, color):
146160
"""Sets the fill of the progress bar. Can be a hex value for a color or ``None`` for

0 commit comments

Comments
 (0)