Skip to content

Commit 176cb79

Browse files
authored
Merge pull request #101 from FoamyGuy/displayio_api_update
displayio api updates
2 parents 1af1781 + e655978 commit 176cb79

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

adafruit_displayio_layout/layouts/tab_layout.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
from adafruit_bitmap_font.bdf import BDF
3030
from adafruit_bitmap_font.pcf import PCF
31+
from circuitpython_typing.displayio import AnyDisplay
3132
from fontio import BuiltinFont
3233
except ImportError:
3334
pass
@@ -53,7 +54,7 @@ class TabLayout(displayio.Group):
5354
5455
:param int x: x location the layout should be placed. Pixel coordinates.
5556
:param int y: y location the layout should be placed. Pixel coordinates.
56-
:param displayio.Display display: The Display object to show the tab layout on.
57+
:param AnyDisplay display: The Display object to show the tab layout on.
5758
:param int tab_text_scale: Size of the text shown in the tabs.
5859
Whole numbers 1 and greater are valid
5960
:param Optional[Union[BuiltinFont, BDF, PCF]] custom_font: A pre-loaded font object to use
@@ -75,7 +76,7 @@ def __init__(
7576
self,
7677
x: int = 0,
7778
y: int = 0,
78-
display: Optional[displayio.Display] = None,
79+
display: Optional[AnyDisplay] = None,
7980
tab_text_scale: int = 1,
8081
custom_font: Optional[Union[BuiltinFont, BDF, PCF]] = terminalio.FONT,
8182
inactive_tab_spritesheet: Optional[str] = None,

adafruit_displayio_layout/widgets/flip_input.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
try:
4040
from typing import Any, List, Optional, Tuple
41+
42+
from circuitpython_typing.displayio import AnyDisplay
4143
except ImportError:
4244
pass
4345

@@ -54,7 +56,7 @@ class FlipInput(Widget, Control):
5456
:param int x: pixel position
5557
:param int y: pixel position
5658
57-
:param displayio.Display display: the display where the widget will be displayed
59+
:param AnyDisplay display: the display where the widget will be displayed
5860
:param value_list: the list of strings that will be displayed
5961
:type value_list: List[str]
6062
:param Font font: the font used for the text (defaults to ``terminalio.FONT``)
@@ -87,7 +89,7 @@ class FlipInput(Widget, Control):
8789

8890
def __init__(
8991
self,
90-
display: displayio.Display,
92+
display: AnyDisplay,
9193
*,
9294
value_list: List[str],
9395
font: FONT = FONT,
@@ -586,7 +588,7 @@ def _blit_constrained(
586588

587589
# _animate_bitmap - performs animation of scrolling between two bitmaps
588590
def _animate_bitmap(
589-
display: displayio.Display,
591+
display: AnyDisplay,
590592
target_bitmap: displayio.Bitmap,
591593
bitmap1: displayio.Bitmap,
592594
bitmap1_offset: Tuple[int, int],

adafruit_displayio_layout/widgets/icon_animated.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
try:
3838
from typing import Any, Optional, Tuple
3939

40-
from busdisplay import BusDisplay
40+
from circuitpython_typing.displayio import AnyDisplay
4141
except ImportError:
4242
pass
4343

@@ -86,7 +86,7 @@ class IconAnimated(IconWidget):
8686
@classmethod
8787
def init_class(
8888
cls,
89-
display: Optional[BusDisplay],
89+
display: Optional[AnyDisplay],
9090
max_scale: float = 1.5,
9191
max_icon_size: Tuple[int, int] = (80, 80),
9292
max_color_depth: int = 256,
@@ -100,7 +100,7 @@ def init_class(
100100
``IconAnimated.init_class(display=board.DISPLAY, max_scale=1.5,
101101
max_icon_size=(80,80), max_color_depth=256)``
102102
103-
:param displayio.Display display: The display where the icons will be displayed.
103+
:param AnyDisplay display: The display where the icons will be displayed.
104104
:param float max_scale: The maximum zoom of the any of the icons, should be >= 1.0,
105105
(default: 1.5)
106106
:param max_icon_size: The maximum (x,y) pixel dimensions of any `IconAnimated` bitmap size

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ adafruit-circuitpython-bitmap-font
88
adafruit-circuitpython-display-text
99
adafruit-circuitpython-imageload
1010
adafruit-circuitpython-display-shapes
11+
adafruit-circuitpython-typing

0 commit comments

Comments
 (0)