Skip to content

Commit 6d473c6

Browse files
committed
fixing logo
1 parent f93f294 commit 6d473c6

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

pcm/build.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ def make_release_dir(version):
1010

1111
src_path = (Path(__file__).parent.parent / "src").absolute()
1212
version_path = src_path / "_version.py"
13-
14-
metadata_template = Path(__file__).parent / "metadata_template.json"
15-
build_path = Path("build").absolute()
16-
1713
icons_path = src_path.parent / "icons"
1814
resources_path = icons_path
15+
metadata_template = Path(__file__).parent / "metadata_template.json"
16+
17+
build_path = Path("build").absolute()
1918

2019
# Delete build and recreate
2120
try:
@@ -30,6 +29,9 @@ def make_release_dir(version):
3029
shutil.copy(
3130
icons_path / "icon-64x64.png", build_path / "plugin" / "resources" / "icon.png"
3231
)
32+
shutil.copy(
33+
icons_path / "icon-24x24.png", build_path / "plugin" / "plugins" / "icon-24x24.png"
34+
)
3335

3436
# Clean out any __pycache__ or .pyc files (https://stackoverflow.com/a/41386937)
3537
[p.unlink() for p in build_path.rglob("*.py[co]")]

src/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import os
21
import sys
32
import threading
43
import time
4+
from pathlib import Path
55

66
import wx
77
import wx.aui
@@ -27,9 +27,7 @@ def callback(_):
2727

2828
while not wx.GetApp():
2929
time.sleep(1)
30-
bm = wx.Bitmap(
31-
os.path.join(os.path.dirname(__file__), "icon.png"), wx.BITMAP_TYPE_PNG
32-
)
30+
bm = wx.Bitmap(str(Meta.icon_file_path), wx.BITMAP_TYPE_PNG)
3331
button_wx_item_id = 0
3432

3533
from pcbnew import ID_H_TOOLBAR

src/plugin.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ class Meta:
6161
version : str = __version__
6262
category : str = "Read PCB"
6363
icon_dir : Path = Path(__file__).parent
64-
icon_base_file_name : str = "icon.png"
64+
icon_file_path : Path = icon_dir / "icon-24x24.png"
65+
# assert icon_file_path.exists()
6566

6667

6768
def setattr_keywords(obj, name, value):
@@ -295,10 +296,7 @@ def __init__(self):
295296
self.pcbnew_icon_support = hasattr(self, "show_toolbar_button")
296297
self.show_toolbar_button = True
297298
self.description = Meta.body
298-
299-
icon_file_path = Meta.icon_dir / Meta.icon_base_file_name
300-
# assert icon_file_path.exists()
301-
self.icon_file_name = str(icon_file_path)
299+
self.icon_file_name = str(Meta.icon_file_path)
302300

303301
def defaults(self):
304302
pass

0 commit comments

Comments
 (0)