Skip to content

Commit

Permalink
fix: embedded icon into source file for wheel.
Browse files Browse the repository at this point in the history
  • Loading branch information
WyvernIXTL committed Nov 7, 2024
1 parent d4b1dc4 commit 393295c
Show file tree
Hide file tree
Showing 5 changed files with 352 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ jobs:
--collect-all gamepadla_plus
--add-data "LICENSE.txt;."
--add-data "THIRD-PARTY-LICENSES.txt;."
--add-data "icon/gamepadla-plus.ico;icon/."
--add-data "icon/gamepadla-plus.png;icon/."
--hide-console hide-late
--hide-console hide-late
--noupx
--icon .\icon\gamepadla-plus.ico
.\gamepadla_plus\__main__.py
Expand Down
12 changes: 2 additions & 10 deletions gamepadla_plus/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@
test_execution,
wrap_data_for_server,
read_license,
project_root_path,
)


def get_icon_path() -> str:
if platform == "win32":
return project_root_path() + "icon/gamepadla-plus.ico"
else:
return project_root_path() + "icon/gamepadla-plus.png"
from gamepadla_plus.icon import ICON


def error_popup(msg: str):
Expand Down Expand Up @@ -231,9 +225,7 @@ def gui():
],
]

window = sg.Window(
"Gamepadla+", layout, finalize=True, size=(400, 560), icon=get_icon_path()
)
window = sg.Window("Gamepadla+", layout, finalize=True, size=(400, 560), icon=ICON)

def update_joysticks():
nonlocal joysticks
Expand Down
14 changes: 14 additions & 0 deletions gamepadla_plus/icon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# The following the base64 encoded Icon of Gamepadla+.
# Gamepadla+ Icon © 2024 by Adam McKellar is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.
# To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/
ICON = b"""
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAACXBIWXMAAAdhAAAH
YQGVw7i2AAAAMFBMVEVHcEwHBwfazcWkmZHf0ccuLi3PwbeupqHn2M1dXFyHgn8f
HRtWT0vz49f+7+P//PLeA3SRAAAADXRSTlMA/fgXnPde/cb8+3k8ABcpMwAAAPZJ
REFUKM9jYBg4YAwimBH8jLsaHR0dd68YQPks797eBYJ77y5ABfL+vgMLzPrBwHAA
JKA/MRao5N7dWe8SuAVAhr0VFAcJTP0r3sAtYAAyIlAIKHC/XGnRb0FBYQYGpnu3
9IEKHr2P/PeMWxiowvbu+//T/96bGKv09gbYjNy7d7VmrnskKP737juwLb13796a
VXcPaNC9XyAFDEAnvF/+9951vbtvQ6fKAG0FO/LuXaBzv659P4eBgQ0ocMUFCJzu
Xf1UfxUscAniK7+rn9ZBBC5DPflV/3012IwEqC+vh6uD3XENFi72qrtBFA9MAQNz
At3iCADRbX5yYfCbsQAAAABJRU5ErkJggg==
"""
Loading

0 comments on commit 393295c

Please sign in to comment.