diff --git a/app/gui/ui.py b/app/gui/ui.py index a63e6fb..80842a7 100644 --- a/app/gui/ui.py +++ b/app/gui/ui.py @@ -358,9 +358,10 @@ class UIBuilderMixin: logo = None try: from PIL import Image, ImageTk # type: ignore + from importlib import resources - logo_path = Path(__file__).resolve().parent / "assets" / "logo.png" - if logo_path.exists(): + logo_resource = resources.files("app.assets").joinpath("logo.png") + with resources.as_file(logo_resource) as logo_path: image = Image.open(logo_path).convert("RGBA") image.thumbnail((26, 26)) logo = ImageTk.PhotoImage(image) diff --git a/pyproject.toml b/pyproject.toml index fce6944..c21f837 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,3 +18,6 @@ package = true [tool.setuptools.packages.find] include = ["app"] + +[tool.setuptools.package-data] +"app" = ["assets/logo.png"]