Skip to content
Merged
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
11 changes: 6 additions & 5 deletions src/napari_matplotlib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

from .util import Interval, from_napari_css_get_size_of

# Icons modified from
# https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/mpl-data/images
ICON_ROOT = Path(__file__).parent / "icons"
__all__ = ["BaseNapariMPLWidget", "NapariMPLWidget"]


Expand Down Expand Up @@ -122,11 +119,15 @@ def _theme_has_light_bg(self) -> bool:
def _get_path_to_icon(self) -> Path:
"""
Get the icons directory (which is theme-dependent).

Icons modified from
https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/mpl-data/images
"""
icon_root = Path(__file__).parent / "icons"
if self._theme_has_light_bg():
return ICON_ROOT / "black"
return icon_root / "black"
else:
return ICON_ROOT / "white"
return icon_root / "white"

def _replace_toolbar_icons(self) -> None:
"""
Expand Down