\Final fix: Python 3.12, added icons and fixed EXE icon"
This commit is contained in:
BIN
assets/icon.ico
Normal file
BIN
assets/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
assets/icons/add.png
Normal file
BIN
assets/icons/add.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 332 B |
BIN
assets/icons/folder.png
Normal file
BIN
assets/icons/folder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 192 B |
BIN
assets/logo.png
Normal file
BIN
assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -26,7 +26,7 @@ exe = EXE(
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
[],
|
||||
name='Citorrent',
|
||||
name='Citorrent',\n icon='assets/icon.ico',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
|
||||
30
create_placeholders.py
Normal file
30
create_placeholders.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import os
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
def create_image(path, color, content, size=(64, 64)):
|
||||
img = Image.new('RGBA', size, (0, 0, 0, 0))
|
||||
draw = ImageDraw.Draw(img)
|
||||
if content == 'logo':
|
||||
margin = 10
|
||||
draw.rounded_rectangle([margin, margin, size[0]-margin, size[1]-margin], radius=15, fill=color)
|
||||
elif content == 'add':
|
||||
r = size[0] // 3
|
||||
center = (size[0]//2, size[1]//2)
|
||||
draw.ellipse([center[0]-r, center[1]-r, center[0]+r, center[1]+r], fill=color)
|
||||
thickness = 4
|
||||
half_len = r // 2
|
||||
draw.line([center[0], center[1]-half_len, center[0], center[1]+half_len], fill='white', width=thickness)
|
||||
draw.line([center[0]-half_len, center[1], center[0]+half_len, center[1]], fill='white', width=thickness)
|
||||
elif content == 'folder':
|
||||
w, h = size[0]-20, size[1]-20
|
||||
x, y = 10, 15
|
||||
draw.rectangle([x, y+10, x+w, y+h], fill=color)
|
||||
draw.rectangle([x, y, x+w//3, y+10], fill=color)
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
img.save(path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
blue = (30, 144, 255, 255)
|
||||
create_image("assets/logo.png", blue, 'logo', size=(512, 512))
|
||||
create_image("assets/icons/add.png", blue, 'add')
|
||||
create_image("assets/icons/folder.png", blue, 'folder')
|
||||
13
make_icon.py
Normal file
13
make_icon.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import os
|
||||
from PIL import Image
|
||||
|
||||
def convert_png_to_ico(png_path, ico_path):
|
||||
try:
|
||||
img = Image.open(png_path)
|
||||
icon_sizes = [(16, 16), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)]
|
||||
img.save(ico_path, format='ICO', sizes=icon_sizes)
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
convert_png_to_ico("assets/logo.png", "assets/icon.ico")
|
||||
Reference in New Issue
Block a user