Skip to content

Commit

Permalink
unions
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Oct 11, 2023
1 parent 1e89504 commit 7f39313
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/magicgui/backends/_ipynb/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class ToolBar(_IPyWidget):

def __init__(self, **kwargs):
super().__init__(ipywidgets.HBox, **kwargs)
self._icon_sz: Tuple[int, int] | None = None
self._icon_sz: Optional[Tuple[int, int]] = None

def _mgui_add_button(self, text: str, icon: str, callback: Callable) -> None:
"""Add an action to the toolbar."""
Expand Down Expand Up @@ -387,11 +387,11 @@ def _mgui_add_widget(self, widget: "Widget") -> None:
"""Add a widget to the toolbar."""
self._add_ipywidget(widget.native)

Check warning on line 388 in src/magicgui/backends/_ipynb/widgets.py

View check run for this annotation

Codecov / codecov/patch

src/magicgui/backends/_ipynb/widgets.py#L388

Added line #L388 was not covered by tests

def _mgui_get_icon_size(self) -> Tuple[int, int] | None:
def _mgui_get_icon_size(self) -> Optional[Tuple[int, int]]:
"""Return the icon size of the toolbar."""
return self._icon_sz

Check warning on line 392 in src/magicgui/backends/_ipynb/widgets.py

View check run for this annotation

Codecov / codecov/patch

src/magicgui/backends/_ipynb/widgets.py#L392

Added line #L392 was not covered by tests

def _mgui_set_icon_size(self, size: int | Tuple[int, int] | None) -> None:
def _mgui_set_icon_size(self, size: Union[int, Tuple[int, int], None]) -> None:
"""Set the icon size of the toolbar."""
if isinstance(size, int):
size = (size, size)
Expand Down

0 comments on commit 7f39313

Please sign in to comment.