File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ def make_release_dir(version):
10
10
11
11
src_path = (Path (__file__ ).parent .parent / "src" ).absolute ()
12
12
version_path = src_path / "_version.py"
13
-
14
- metadata_template = Path (__file__ ).parent / "metadata_template.json"
15
- build_path = Path ("build" ).absolute ()
16
-
17
13
icons_path = src_path .parent / "icons"
18
14
resources_path = icons_path
15
+ metadata_template = Path (__file__ ).parent / "metadata_template.json"
16
+
17
+ build_path = Path ("build" ).absolute ()
19
18
20
19
# Delete build and recreate
21
20
try :
@@ -30,6 +29,9 @@ def make_release_dir(version):
30
29
shutil .copy (
31
30
icons_path / "icon-64x64.png" , build_path / "plugin" / "resources" / "icon.png"
32
31
)
32
+ shutil .copy (
33
+ icons_path / "icon-24x24.png" , build_path / "plugin" / "plugins" / "icon-24x24.png"
34
+ )
33
35
34
36
# Clean out any __pycache__ or .pyc files (https://stackoverflow.com/a/41386937)
35
37
[p .unlink () for p in build_path .rglob ("*.py[co]" )]
Original file line number Diff line number Diff line change 1
- import os
2
1
import sys
3
2
import threading
4
3
import time
4
+ from pathlib import Path
5
5
6
6
import wx
7
7
import wx .aui
@@ -27,9 +27,7 @@ def callback(_):
27
27
28
28
while not wx .GetApp ():
29
29
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 )
33
31
button_wx_item_id = 0
34
32
35
33
from pcbnew import ID_H_TOOLBAR
Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ class Meta:
61
61
version : str = __version__
62
62
category : str = "Read PCB"
63
63
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()
65
66
66
67
67
68
def setattr_keywords (obj , name , value ):
@@ -295,10 +296,7 @@ def __init__(self):
295
296
self .pcbnew_icon_support = hasattr (self , "show_toolbar_button" )
296
297
self .show_toolbar_button = True
297
298
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 )
302
300
303
301
def defaults (self ):
304
302
pass
You can’t perform that action at this time.
0 commit comments