style(icon): update application, taskbar and in-app logo with cropped metallic LD icon
This commit is contained in:
parent
9ee7d42a8b
commit
3dd1e04f29
3 changed files with 37 additions and 16 deletions
BIN
assets/logo.ico
BIN
assets/logo.ico
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 144 KiB |
BIN
assets/logo.png
BIN
assets/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 347 KiB |
53
ui/app.py
53
ui/app.py
|
|
@ -27,23 +27,23 @@ from core.dependencies import get_ytdlp_status, get_ffmpeg_status, get_js_status
|
||||||
|
|
||||||
class LDownloaderApp(tk.Tk):
|
class LDownloaderApp(tk.Tk):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
# Windows Yüksek DPI ve Görev Çubuğu (Taskbar) İkon Kimliği — Pencere oluşturulmadan ÖNCE çağrılmalıdır
|
||||||
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ı
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
try:
|
try:
|
||||||
ctypes.windll.shcore.SetProcessDpiAwareness(1)
|
ctypes.windll.shcore.SetProcessDpiAwareness(1)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("ldownloader.modern.gui.3")
|
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("lildosto.ldownloader.v35.icon")
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
super().__init__()
|
||||||
|
self.title("LDownloader v3.5.0")
|
||||||
|
self.geometry("980x660")
|
||||||
|
self.minsize(880, 580)
|
||||||
|
self.configure(bg=BG)
|
||||||
|
|
||||||
# Ekranı ortala
|
# Ekranı ortala
|
||||||
self.update_idletasks()
|
self.update_idletasks()
|
||||||
sw = self.winfo_screenwidth()
|
sw = self.winfo_screenwidth()
|
||||||
|
|
@ -80,24 +80,45 @@ class LDownloaderApp(tk.Tk):
|
||||||
ico_path = os.path.join(app_dir, "logo.ico")
|
ico_path = os.path.join(app_dir, "logo.ico")
|
||||||
if os.path.isfile(ico_path):
|
if os.path.isfile(ico_path):
|
||||||
try:
|
try:
|
||||||
self.iconbitmap(ico_path)
|
self.iconbitmap(default=ico_path)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
try:
|
||||||
|
self.iconbitmap(ico_path)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
self.logo_img = None
|
self.logo_img = None
|
||||||
self.window_icon_img = None
|
self.window_icon_img = None
|
||||||
|
self.window_icon_imgs = []
|
||||||
png_path = os.path.join(app_dir, "assets", "logo.png")
|
png_path = os.path.join(app_dir, "assets", "logo.png")
|
||||||
if not os.path.isfile(png_path):
|
if not os.path.isfile(png_path):
|
||||||
png_path = os.path.join(app_dir, "logo.png")
|
png_path = os.path.join(app_dir, "logo.png")
|
||||||
if os.path.isfile(png_path):
|
if os.path.isfile(png_path):
|
||||||
try:
|
try:
|
||||||
raw = tk.PhotoImage(file=png_path)
|
from PIL import Image, ImageTk
|
||||||
self.window_icon_img = raw
|
pil_img = Image.open(png_path).convert("RGBA")
|
||||||
self.iconphoto(True, raw)
|
# Kenar boşluğu kalmışsa otomatik kırp
|
||||||
factor = max(1, raw.width() // 24)
|
bbox = pil_img.getbbox()
|
||||||
self.logo_img = raw.subsample(factor, factor)
|
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:
|
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):
|
def _build_layout(self):
|
||||||
# ── Birleşik Üst Çubuk (Logo + Sekmeler + Durum) ────────────
|
# ── Birleşik Üst Çubuk (Logo + Sekmeler + Durum) ────────────
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue