add mac app icon (#774)
This commit is contained in:
1 parent
c7ad6fe5fb
commit
8cab67f57a
3 files changed
+12
-9
No files matched your search
+4
-1
@@ -22,7 +22,10 @@ kivy.require("2.0.0")
|
|||||||
from katrain.core.utils import find_package_resource, PATHS
|
from katrain.core.utils import find_package_resource, PATHS
|
||||||
from kivy.config import Config
|
from kivy.config import Config
|
||||||
|
|
||||||
ICON = find_package_resource("katrain/img/icon.ico")
|
if kivy_platform == "macosx":
|
||||||
|
ICON = find_package_resource("katrain/img/icon.icns")
|
||||||
|
else:
|
||||||
|
ICON = find_package_resource("katrain/img/icon.ico")
|
||||||
Config.set("kivy", "window_icon", ICON)
|
Config.set("kivy", "window_icon", ICON)
|
||||||
Config.set("input", "mouse", "mouse,multitouch_on_demand")
|
Config.set("input", "mouse", "mouse,multitouch_on_demand")
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
+8
-8
@@ -110,7 +110,7 @@ EXCLUDE = ["KataGoData", "anim_", "screenshot_", "__pycache__"]
|
|||||||
a.datas = [
|
a.datas = [
|
||||||
(ff, ft, tp)
|
(ff, ft, tp)
|
||||||
for ff, ft, tp in a.datas
|
for ff, ft, tp in a.datas
|
||||||
if not any(ff.endswith(suffix) for suffix in EXCLUDE_SUFFIX)
|
if not any(ff.endswith(suffix) for suffix in EXCLUDE_SUFFIX)
|
||||||
and not any(kw in ff for kw in EXCLUDE)
|
and not any(kw in ff for kw in EXCLUDE)
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -119,16 +119,16 @@ print("DATA FILTERED", len(a.datas))
|
|||||||
# Platform-specific build configurations
|
# Platform-specific build configurations
|
||||||
if is_windows:
|
if is_windows:
|
||||||
console_names = {True: "DebugKaTrain", False: "KaTrain"}
|
console_names = {True: "DebugKaTrain", False: "KaTrain"}
|
||||||
|
|
||||||
# Setup PowerShell for signing (Windows only)
|
# Setup PowerShell for signing (Windows only)
|
||||||
try:
|
try:
|
||||||
powershell = subprocess.Popen(["powershell"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
powershell = subprocess.Popen(["powershell"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||||
except:
|
except:
|
||||||
powershell = None
|
powershell = None
|
||||||
|
|
||||||
for console, name in console_names.items():
|
for console, name in console_names.items():
|
||||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
exe = EXE(
|
exe = EXE(
|
||||||
pyz,
|
pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
@@ -172,7 +172,7 @@ if is_windows:
|
|||||||
icon=f"{base_path}/img/icon.ico",
|
icon=f"{base_path}/img/icon.ico",
|
||||||
version=version_info,
|
version=version_info,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Code signing (Windows) - skip in CI environment
|
# Code signing (Windows) - skip in CI environment
|
||||||
if powershell and not os.environ.get('GITHUB_ACTIONS'):
|
if powershell and not os.environ.get('GITHUB_ACTIONS'):
|
||||||
powershell.stdin.write(f"Set-AuthenticodeSignature dist/{name}.exe -Certificate (Get-ChildItem Cert:\\CurrentUser\\My -CodeSigningCert)\n".encode('ascii'))
|
powershell.stdin.write(f"Set-AuthenticodeSignature dist/{name}.exe -Certificate (Get-ChildItem Cert:\\CurrentUser\\My -CodeSigningCert)\n".encode('ascii'))
|
||||||
@@ -216,11 +216,11 @@ else:
|
|||||||
if is_macos:
|
if is_macos:
|
||||||
# Get version from environment or default
|
# Get version from environment or default
|
||||||
app_version = os.environ.get('KATRAIN_VERSION', '1.0.0')
|
app_version = os.environ.get('KATRAIN_VERSION', '1.0.0')
|
||||||
|
|
||||||
app = BUNDLE(
|
app = BUNDLE(
|
||||||
coll,
|
coll,
|
||||||
name='KaTrain.app',
|
name='KaTrain.app',
|
||||||
icon=f'{base_path}/img/icon.ico',
|
icon=f'{base_path}/img/icon.icns',
|
||||||
bundle_identifier='org.katrain.KaTrain',
|
bundle_identifier='org.katrain.KaTrain',
|
||||||
version=app_version,
|
version=app_version,
|
||||||
info_plist={
|
info_plist={
|
||||||
@@ -246,4 +246,4 @@ else:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
Reference in new issue
Block a user