@@ -50,14 +50,14 @@ class TabLayout(displayio.Group):
50
50
:param Optional[Union[BuiltinFont, BDF, PCF]] custom_font: A pre-loaded font object to use
51
51
for the tab labels
52
52
:param str inactive_tab_spritesheet: Filepath of the spritesheet to show for inactive tabs.
53
- :param str active_tab_spritesheet : Filepath of the spritesheet to show for the active tab.
54
- :param Optional[int, tuple[int, int, int]] active_tab_text_color : Hex or tuple color to use
53
+ :param str showing_tab_spritesheet : Filepath of the spritesheet to show for the active tab.
54
+ :param Optional[int, tuple[int, int, int]] showing_tab_text_color : Hex or tuple color to use
55
55
for the active tab label
56
56
:param Optional[int, tuple[int, int, int]] inactive_tab_text_color: Hex or tuple color to
57
57
use for inactive tab labels
58
58
:param Optional[Union[int, tuple[int, int]]] inactive_tab_transparent_indexes: single index
59
59
or tuple of multiple indexes to be made transparent in the inactive tab sprite palette.
60
- :param Optional[Union[int, tuple[int, int]]] active_tab_transparent_indexes : single index
60
+ :param Optional[Union[int, tuple[int, int]]] showing_tab_transparent_indexes : single index
61
61
or tuple of multiple indexes to be made transparent in the active tab sprite palette.
62
62
:param int tab_count: How many tabs to draw in the layout. Positive whole numbers are valid.
63
63
"""
@@ -72,11 +72,11 @@ def __init__(
72
72
tab_text_scale : int = 1 ,
73
73
custom_font : Optional [Union [BuiltinFont , BDF , PCF ]] = terminalio .FONT ,
74
74
inactive_tab_spritesheet : Optional [str ] = None ,
75
- active_tab_spritesheet : Optional [str ] = None ,
76
- active_tab_text_color : Optional [Union [int , Tuple [int , int , int ]]] = 0x999999 ,
75
+ showing_tab_spritesheet : Optional [str ] = None ,
76
+ showing_tab_text_color : Optional [Union [int , Tuple [int , int , int ]]] = 0x999999 ,
77
77
inactive_tab_text_color : Optional [Union [int , Tuple [int , int , int ]]] = 0xFFFFF ,
78
78
inactive_tab_transparent_indexes : Optional [Union [int , Tuple [int , int ]]] = None ,
79
- active_tab_transparent_indexes : Optional [Union [int , Tuple [int , int ]]] = None ,
79
+ showing_tab_transparent_indexes : Optional [Union [int , Tuple [int , int ]]] = None ,
80
80
tab_count : int = None ,
81
81
):
82
82
@@ -88,24 +88,24 @@ def __init__(
88
88
display = board .DISPLAY
89
89
if inactive_tab_spritesheet is None :
90
90
raise AttributeError ("Must pass active_tab_spritesheet" )
91
- if active_tab_spritesheet is None :
91
+ if showing_tab_spritesheet is None :
92
92
raise AttributeError ("Must pass inactive_tab_spritesheet" )
93
93
if tab_count is None :
94
94
raise AttributeError ("Must pass tab_count" )
95
95
96
96
super ().__init__ (x = x , y = y )
97
97
self .tab_count = tab_count
98
98
self ._active_bmp , self ._active_palette = adafruit_imageload .load (
99
- active_tab_spritesheet
99
+ showing_tab_spritesheet
100
100
)
101
101
self ._inactive_bmp , self ._inactive_palette = adafruit_imageload .load (
102
102
inactive_tab_spritesheet
103
103
)
104
104
105
- if isinstance (active_tab_transparent_indexes , int ):
106
- self ._active_palette .make_transparent (active_tab_transparent_indexes )
107
- elif isinstance (active_tab_transparent_indexes , tuple ):
108
- for index in active_tab_transparent_indexes :
105
+ if isinstance (showing_tab_transparent_indexes , int ):
106
+ self ._active_palette .make_transparent (showing_tab_transparent_indexes )
107
+ elif isinstance (showing_tab_transparent_indexes , tuple ):
108
+ for index in showing_tab_transparent_indexes :
109
109
self ._active_palette .make_transparent (index )
110
110
else :
111
111
raise AttributeError ("active_tab_transparent_indexes must be int or tuple" )
@@ -122,7 +122,7 @@ def __init__(
122
122
123
123
self .tab_height = self ._active_bmp .height
124
124
self .display = display
125
- self .active_tab_text_color = active_tab_text_color
125
+ self .active_tab_text_color = showing_tab_text_color
126
126
self .inactive_tab_text_color = inactive_tab_text_color
127
127
self .custom_font = custom_font
128
128
self .tab_text_scale = tab_text_scale
0 commit comments