diff --git a/Launcher.py b/Launcher.py index a9c9a318..7acaeb78 100644 --- a/Launcher.py +++ b/Launcher.py @@ -146,7 +146,7 @@ def launch(exe, in_terminal=False): def run_gui(): from kvui import App, ContainerLayout, GridLayout, Button, Label - from kivy.uix.image import Image + from kivy.uix.image import AsyncImage from kivy.uix.relativelayout import RelativeLayout class Launcher(App): @@ -188,7 +188,8 @@ def run_gui(): button.component = component button.bind(on_release=self.component_action) if component.icon != "icon": - image = Image(source=icon_paths[component.icon], size=(38, 38), size_hint=(None, 1), pos=(5, 0)) + image = AsyncImage(source=icon_paths[component.icon], + size=(38, 38), size_hint=(None, 1), pos=(5, 0)) box_layout = RelativeLayout() box_layout.add_widget(button) box_layout.add_widget(image) diff --git a/data/mcicon.png b/data/mcicon.png new file mode 100644 index 00000000..6b8fc548 Binary files /dev/null and b/data/mcicon.png differ diff --git a/setup.py b/setup.py index 94a242f0..13b12251 100644 --- a/setup.py +++ b/setup.py @@ -157,11 +157,22 @@ build_arch = build_platform.split('-')[-1] if '-' in build_platform else platfor # see Launcher.py on how to add scripts to setup.py +def resolve_icon(icon_name: str): + base_path = icon_paths[icon_name] + if is_windows: + path, extension = os.path.splitext(base_path) + ico_file = path + ".ico" + assert os.path.exists(ico_file), f"ico counterpart of {base_path} should exist." + return ico_file + else: + return base_path + + exes = [ cx_Freeze.Executable( script=f'{c.script_name}.py', target_name=c.frozen_name + (".exe" if is_windows else ""), - icon=icon_paths[c.icon], + icon=resolve_icon(c.icon), base="Win32GUI" if is_windows and not c.cli else None ) for c in components if c.script_name and c.frozen_name ] diff --git a/worlds/LauncherComponents.py b/worlds/LauncherComponents.py index d9f04e60..2e1152a8 100644 --- a/worlds/LauncherComponents.py +++ b/worlds/LauncherComponents.py @@ -101,7 +101,7 @@ components: List[Component] = [ icon_paths = { - 'icon': local_path('data', 'icon.ico' if is_windows else 'icon.png'), - 'mcicon': local_path('data', 'mcicon.ico'), + 'icon': local_path('data', 'icon.png'), + 'mcicon': local_path('data', 'mcicon.png'), 'discord': local_path('data', 'discord-mark-blue.png'), }