Skip to content

Commit 20a64df

Browse files
committed
use showing instead of active throughout API
1 parent 801bdcb commit 20a64df

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

adafruit_displayio_layout/layouts/tab_layout.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ class TabLayout(displayio.Group):
5050
:param Optional[Union[BuiltinFont, BDF, PCF]] custom_font: A pre-loaded font object to use
5151
for the tab labels
5252
: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
5555
for the active tab label
5656
:param Optional[int, tuple[int, int, int]] inactive_tab_text_color: Hex or tuple color to
5757
use for inactive tab labels
5858
:param Optional[Union[int, tuple[int, int]]] inactive_tab_transparent_indexes: single index
5959
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
6161
or tuple of multiple indexes to be made transparent in the active tab sprite palette.
6262
:param int tab_count: How many tabs to draw in the layout. Positive whole numbers are valid.
6363
"""
@@ -72,11 +72,11 @@ def __init__(
7272
tab_text_scale: int = 1,
7373
custom_font: Optional[Union[BuiltinFont, BDF, PCF]] = terminalio.FONT,
7474
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,
7777
inactive_tab_text_color: Optional[Union[int, Tuple[int, int, int]]] = 0xFFFFF,
7878
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,
8080
tab_count: int = None,
8181
):
8282

@@ -88,24 +88,24 @@ def __init__(
8888
display = board.DISPLAY
8989
if inactive_tab_spritesheet is None:
9090
raise AttributeError("Must pass active_tab_spritesheet")
91-
if active_tab_spritesheet is None:
91+
if showing_tab_spritesheet is None:
9292
raise AttributeError("Must pass inactive_tab_spritesheet")
9393
if tab_count is None:
9494
raise AttributeError("Must pass tab_count")
9595

9696
super().__init__(x=x, y=y)
9797
self.tab_count = tab_count
9898
self._active_bmp, self._active_palette = adafruit_imageload.load(
99-
active_tab_spritesheet
99+
showing_tab_spritesheet
100100
)
101101
self._inactive_bmp, self._inactive_palette = adafruit_imageload.load(
102102
inactive_tab_spritesheet
103103
)
104104

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:
109109
self._active_palette.make_transparent(index)
110110
else:
111111
raise AttributeError("active_tab_transparent_indexes must be int or tuple")
@@ -122,7 +122,7 @@ def __init__(
122122

123123
self.tab_height = self._active_bmp.height
124124
self.display = display
125-
self.active_tab_text_color = active_tab_text_color
125+
self.active_tab_text_color = showing_tab_text_color
126126
self.inactive_tab_text_color = inactive_tab_text_color
127127
self.custom_font = custom_font
128128
self.tab_text_scale = tab_text_scale

examples/displayio_layout_tab_layout_simpletest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
tab_text_scale=2,
3434
custom_font=font,
3535
inactive_tab_spritesheet="bmps/inactive_tab_sprite.bmp",
36-
active_tab_spritesheet="bmps/active_tab_sprite.bmp",
37-
active_tab_text_color=0x00AA59,
36+
showing_tab_spritesheet="bmps/active_tab_sprite.bmp",
37+
showing_tab_text_color=0x00AA59,
3838
inactive_tab_text_color=0xEEEEEE,
3939
inactive_tab_transparent_indexes=(0, 1),
40-
active_tab_transparent_indexes=(0, 1),
40+
showing_tab_transparent_indexes=(0, 1),
4141
tab_count=4,
4242
)
4343

examples/displayio_layout_tab_layout_touchtest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
tab_text_scale=2,
4747
custom_font=font,
4848
inactive_tab_spritesheet="bmps/inactive_tab_sprite.bmp",
49-
active_tab_spritesheet="bmps/active_tab_sprite.bmp",
50-
active_tab_text_color=0x00AA59,
49+
showing_tab_spritesheet="bmps/active_tab_sprite.bmp",
50+
showing_tab_text_color=0x00AA59,
5151
inactive_tab_text_color=0xEEEEEE,
5252
inactive_tab_transparent_indexes=(0, 1),
53-
active_tab_transparent_indexes=(0, 1),
53+
showing_tab_transparent_indexes=(0, 1),
5454
tab_count=4,
5555
)
5656

0 commit comments

Comments
 (0)