File tree Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ from importlib .resources import files , as_file
4+
35import argparse
46import colour
57import importlib
@@ -241,6 +243,11 @@ def update_directory_config(config: Dict):
241243
242244def update_window_config (config : Dict , args : Namespace ):
243245 window_config = config .window
246+
247+ resource = files ("manimlib" ) / "assets" / "icon.png"
248+ with as_file (resource ) as icon_path :
249+ window_config .icon_path = str (icon_path ) if icon_path .exists () else None
250+
244251 for key in "position" , "size" :
245252 if window_config .get (key ):
246253 window_config [key ] = literal_eval (window_config [key ])
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ def __init__(
3838 size : Optional [tuple [int , int ]] = None ,
3939 position : Optional [tuple [int , int ]] = None ,
4040 samples : int = 0 ,
41+ icon_path : str = None ,
4142 ):
4243 self .scene = scene
4344 self .monitor = self .get_monitor (monitor_index )
@@ -68,6 +69,9 @@ def __init__(
6869 config = config ,
6970 )
7071
72+ if icon_path :
73+ self .set_icon (pyglet .image .load (icon_path ))
74+
7175 self .set_mouse_visible (self .cursor )
7276 self .set_mouse_passthrough (False )
7377 self .to_default_position ()
Original file line number Diff line number Diff line change @@ -60,6 +60,9 @@ install_requires =
6060 typing-extensions; python_version < "3.11"
6161 validators
6262
63+ [options.package_data]
64+ manimgl = assets/*.png
65+
6366[options.entry_points]
6467console_scripts =
6568 manimgl = manimlib.__main__:main
You can’t perform that action at this time.
0 commit comments