Skip to content

displayio api updates #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions adafruit_displayio_layout/layouts/tab_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

from adafruit_bitmap_font.bdf import BDF
from adafruit_bitmap_font.pcf import PCF
from circuitpython_typing.displayio import AnyDisplay
from fontio import BuiltinFont
except ImportError:
pass
Expand All @@ -53,7 +54,7 @@ class TabLayout(displayio.Group):

:param int x: x location the layout should be placed. Pixel coordinates.
:param int y: y location the layout should be placed. Pixel coordinates.
:param displayio.Display display: The Display object to show the tab layout on.
:param AnyDisplay display: The Display object to show the tab layout on.
:param int tab_text_scale: Size of the text shown in the tabs.
Whole numbers 1 and greater are valid
:param Optional[Union[BuiltinFont, BDF, PCF]] custom_font: A pre-loaded font object to use
Expand All @@ -75,7 +76,7 @@ def __init__(
self,
x: int = 0,
y: int = 0,
display: Optional[displayio.Display] = None,
display: Optional[AnyDisplay] = None,
tab_text_scale: int = 1,
custom_font: Optional[Union[BuiltinFont, BDF, PCF]] = terminalio.FONT,
inactive_tab_spritesheet: Optional[str] = None,
Expand Down
8 changes: 5 additions & 3 deletions adafruit_displayio_layout/widgets/flip_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

try:
from typing import Any, List, Optional, Tuple

from circuitpython_typing.displayio import AnyDisplay
except ImportError:
pass

Expand All @@ -54,7 +56,7 @@ class FlipInput(Widget, Control):
:param int x: pixel position
:param int y: pixel position

:param displayio.Display display: the display where the widget will be displayed
:param AnyDisplay display: the display where the widget will be displayed
:param value_list: the list of strings that will be displayed
:type value_list: List[str]
:param Font font: the font used for the text (defaults to ``terminalio.FONT``)
Expand Down Expand Up @@ -87,7 +89,7 @@ class FlipInput(Widget, Control):

def __init__(
self,
display: displayio.Display,
display: AnyDisplay,
*,
value_list: List[str],
font: FONT = FONT,
Expand Down Expand Up @@ -586,7 +588,7 @@ def _blit_constrained(

# _animate_bitmap - performs animation of scrolling between two bitmaps
def _animate_bitmap(
display: displayio.Display,
display: AnyDisplay,
target_bitmap: displayio.Bitmap,
bitmap1: displayio.Bitmap,
bitmap1_offset: Tuple[int, int],
Expand Down
6 changes: 3 additions & 3 deletions adafruit_displayio_layout/widgets/icon_animated.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
try:
from typing import Any, Optional, Tuple

from busdisplay import BusDisplay
from circuitpython_typing.displayio import AnyDisplay
except ImportError:
pass

Expand Down Expand Up @@ -86,7 +86,7 @@ class IconAnimated(IconWidget):
@classmethod
def init_class(
cls,
display: Optional[BusDisplay],
display: Optional[AnyDisplay],
max_scale: float = 1.5,
max_icon_size: Tuple[int, int] = (80, 80),
max_color_depth: int = 256,
Expand All @@ -100,7 +100,7 @@ def init_class(
``IconAnimated.init_class(display=board.DISPLAY, max_scale=1.5,
max_icon_size=(80,80), max_color_depth=256)``

:param displayio.Display display: The display where the icons will be displayed.
:param AnyDisplay display: The display where the icons will be displayed.
:param float max_scale: The maximum zoom of the any of the icons, should be >= 1.0,
(default: 1.5)
:param max_icon_size: The maximum (x,y) pixel dimensions of any `IconAnimated` bitmap size
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ adafruit-circuitpython-bitmap-font
adafruit-circuitpython-display-text
adafruit-circuitpython-imageload
adafruit-circuitpython-display-shapes
adafruit-circuitpython-typing