Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6702c17

Browse filesBrowse files
authored
Merge pull request #144 from samcunliffe/icon_root-no-longer-global
`ICON_ROOT` no longer needs to be a global.
2 parents e742e3b + f5855c2 commit 6702c17
Copy full SHA for 6702c17

File tree

1 file changed

+6
-5
lines changed
Filter options

1 file changed

+6
-5
lines changed

‎src/napari_matplotlib/base.py

Copy file name to clipboardExpand all lines: src/napari_matplotlib/base.py
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
from .util import Interval, from_napari_css_get_size_of
1616

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

2219

@@ -122,11 +119,15 @@ def _theme_has_light_bg(self) -> bool:
122119
def _get_path_to_icon(self) -> Path:
123120
"""
124121
Get the icons directory (which is theme-dependent).
122+
123+
Icons modified from
124+
https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/mpl-data/images
125125
"""
126+
icon_root = Path(__file__).parent / "icons"
126127
if self._theme_has_light_bg():
127-
return ICON_ROOT / "black"
128+
return icon_root / "black"
128129
else:
129-
return ICON_ROOT / "white"
130+
return icon_root / "white"
130131

131132
def _replace_toolbar_icons(self) -> None:
132133
"""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.