style(icon): update application, taskbar and in-app logo with cropped metallic LD icon

This commit is contained in:
LilDosto 2026-11-04 04:08:57 +03:00
parent 9ee7d42a8b
commit 3dd1e04f29
3 changed files with 37 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 347 KiB

View file

@ -27,23 +27,23 @@ from core.dependencies import get_ytdlp_status, get_ffmpeg_status, get_js_status
class LDownloaderApp(tk.Tk):
def __init__(self):
super().__init__()
self.title("LDownloader v3.5.0")
self.geometry("980x660")
self.minsize(880, 580)
self.configure(bg=BG)
# Windows Yüksek DPI ve AppUserModelID yapılandırması
# Windows Yüksek DPI ve Görev Çubuğu (Taskbar) İkon Kimliği — Pencere oluşturulmadan ÖNCE çağrılmalıdır
if sys.platform == "win32":
try:
ctypes.windll.shcore.SetProcessDpiAwareness(1)
except Exception:
pass
try:
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("ldownloader.modern.gui.3")
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("lildosto.ldownloader.v35.icon")
except Exception:
pass
super().__init__()
self.title("LDownloader v3.5.0")
self.geometry("980x660")
self.minsize(880, 580)
self.configure(bg=BG)
# Ekranı ortala
self.update_idletasks()
sw = self.winfo_screenwidth()
@ -80,24 +80,45 @@ class LDownloaderApp(tk.Tk):
ico_path = os.path.join(app_dir, "logo.ico")
if os.path.isfile(ico_path):
try:
self.iconbitmap(ico_path)
self.iconbitmap(default=ico_path)
except Exception:
pass
try:
self.iconbitmap(ico_path)
except Exception:
pass
self.logo_img = None
self.window_icon_img = None
self.window_icon_imgs = []
png_path = os.path.join(app_dir, "assets", "logo.png")
if not os.path.isfile(png_path):
png_path = os.path.join(app_dir, "logo.png")
if os.path.isfile(png_path):
try:
raw = tk.PhotoImage(file=png_path)
self.window_icon_img = raw
self.iconphoto(True, raw)
factor = max(1, raw.width() // 24)
self.logo_img = raw.subsample(factor, factor)
from PIL import Image, ImageTk
pil_img = Image.open(png_path).convert("RGBA")
# Kenar boşluğu kalmışsa otomatik kırp
bbox = pil_img.getbbox()
if bbox:
pil_img = pil_img.crop(bbox)
for sz in (256, 64, 48, 32, 16):
self.window_icon_imgs.append(
ImageTk.PhotoImage(pil_img.resize((sz, sz), Image.Resampling.LANCZOS))
)
self.window_icon_img = self.window_icon_imgs[0]
self.iconphoto(True, *self.window_icon_imgs)
self.logo_img = ImageTk.PhotoImage(
pil_img.resize((28, 28), Image.Resampling.LANCZOS)
)
except Exception:
pass
try:
raw = tk.PhotoImage(file=png_path)
self.window_icon_img = raw
self.iconphoto(True, raw)
factor = max(1, raw.width() // 28)
self.logo_img = raw.subsample(factor, factor)
except Exception:
pass
def _build_layout(self):
# ── Birleşik Üst Çubuk (Logo + Sekmeler + Durum) ────────────