Skip to content

Commit a33f65c

Browse files
committed
Use 3b1b icon as the application's one
1 parent 00103ae commit a33f65c

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

manimlib/assets/icon.png

48.2 KB
Loading

manimlib/config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from importlib.resources import files, as_file
4+
35
import argparse
46
import colour
57
import importlib
@@ -241,6 +243,11 @@ def update_directory_config(config: Dict):
241243

242244
def 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])

manimlib/window.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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()

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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]
6467
console_scripts =
6568
manimgl = manimlib.__main__:main

0 commit comments

Comments
 (0)