@@ -48,20 +48,24 @@ class Button(ButtonBase):
48
48
:param int y: The y position of the button.
49
49
:param int width: The width of the button in pixels.
50
50
:param int height: The height of the button in pixels.
51
- :param str name: The name of the button.
51
+ :param Optional[ str] name: The name of the button.
52
52
:param style: The style of the button. Can be RECT, ROUNDRECT, SHADOWRECT, SHADOWROUNDRECT.
53
53
Defaults to RECT.
54
- :param int|Tuple(int, int, int) fill_color: The color to fill the button. Defaults to 0xFFFFFF.
55
- :param int|Tuple(int, int, int) outline_color: The color of the outline of the button.
56
- :param str label: The text that appears inside the button.
57
- :param FontProtocol label_font: The button label font. Defaults to ''terminalio.FONT''
58
- :param int|Tuple(int, int, int) label_color: The color of the button label text. Defaults to 0x0.
59
- :param int|Tuple(int, int, int) selected_fill: The fill color when the button is selected.
60
- Defaults to the inverse of the fill_color.
61
- :param int|Tuple(int, int, int) selected_outline: The outline color when the button is selected.
62
- Defaults to the inverse of outline_color.
63
- :param selected_label: The label color when the button is selected.
64
- Defaults to inverting the label_color.
54
+ :param Optional[Union[int, Tuple[int, int, int]]] fill_color: The color to fill the button.
55
+ Accepts an int or a tuple of 3 integers representing RGB values. Defaults to 0xFFFFFF.
56
+ :param Optional[Union[int, Tuple[int, int, int]]] outline_color: The color of the outline of the button.
57
+ Accepts an int or a tuple of 3 integers representing RGB values. Defaults to 0x0.
58
+ :param Optional[str] label: The text that appears inside the button.
59
+ :param Optional[FontProtocol] label_font: The button label font. Defaults to ''terminalio.FONT''
60
+ :param Optional[Union[int, Tuple[int, int, int]]] label_color: The color of the button label text.
61
+ Accepts an int or a tuple of 3 integers representing RGB values. Defaults to 0x0.
62
+ :param Optional[Union[int, Tuple[int, int, int]]] selected_fill: The fill color when the button is selected.
63
+ Accepts an int or a tuple of 3 integers representing RGB values. Defaults to the inverse of the fill_color.
64
+ :param Optional[Union[int, Tuple[int, int, int]]] selected_outline: The outline color when the button is selected.
65
+ Accepts an int or a tuple of 3 integers representing RGB values. Defaults to the inverse of outline_color.
66
+ :param Optional[Union[int, Tuple[int, int, int]]] selected_label: The label color when the button is selected.
67
+ Accepts an int or a tuple of 3 integers representing RGB values. Defaults to inverting the label_color.
68
+ :param Optional[int] label_scale: The scale factor used for the label. Defaults to 1.
65
69
"""
66
70
67
71
def _empty_self_group (self ) -> None :
@@ -140,7 +144,7 @@ def __init__(
140
144
outline_color : Optional [Union [int , tuple [int , int , int ]]] = 0x0 ,
141
145
label : Optional [str ] = None ,
142
146
label_font : Optional [FontProtocol ] = None ,
143
- label_color : Optional [int ] = 0x0 ,
147
+ label_color : Optional [Union [ int , tuple [ int , int , int ]] ] = 0x0 ,
144
148
selected_fill : Optional [Union [int , tuple [int , int , int ]]] = None ,
145
149
selected_outline : Optional [Union [int , tuple [int , int , int ]]] = None ,
146
150
selected_label : Optional [Union [int , tuple [int , int , int ]]] = None ,
@@ -217,7 +221,7 @@ def fill_color(self) -> Optional[int]:
217
221
return self ._fill_color
218
222
219
223
@fill_color .setter
220
- def fill_color (self , new_color : Optional [ Union [int , tuple [int , int , int ] ]]) -> None :
224
+ def fill_color (self , new_color : Union [int , tuple [int , int , int ]]) -> None :
221
225
self ._fill_color = _check_color (new_color )
222
226
if not self .selected :
223
227
self .body .fill = self ._fill_color
@@ -228,7 +232,7 @@ def outline_color(self) -> Optional[int]:
228
232
return self ._outline_color
229
233
230
234
@outline_color .setter
231
- def outline_color (self , new_color : Optional [ Union [int , tuple [int , int , int ] ]]) -> None :
235
+ def outline_color (self , new_color : Union [int , tuple [int , int , int ]]) -> None :
232
236
self ._outline_color = _check_color (new_color )
233
237
if not self .selected :
234
238
self .body .outline = self ._outline_color
@@ -239,7 +243,7 @@ def selected_fill(self) -> Optional[int]:
239
243
return self ._selected_fill
240
244
241
245
@selected_fill .setter
242
- def selected_fill (self , new_color : Optional [ Union [int , tuple [int , int , int ] ]]) -> None :
246
+ def selected_fill (self , new_color : Union [int , tuple [int , int , int ]]) -> None :
243
247
self ._selected_fill = _check_color (new_color )
244
248
if self .selected :
245
249
self .body .fill = self ._selected_fill
@@ -250,7 +254,7 @@ def selected_outline(self) -> Optional[int]:
250
254
return self ._selected_outline
251
255
252
256
@selected_outline .setter
253
- def selected_outline (self , new_color : Optional [ Union [int , tuple [int , int , int ] ]]) -> None :
257
+ def selected_outline (self , new_color : Union [int , tuple [int , int , int ]]) -> None :
254
258
self ._selected_outline = _check_color (new_color )
255
259
if self .selected :
256
260
self .body .outline = self ._selected_outline
0 commit comments