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 |
39
ui/app.py
39
ui/app.py
|
|
@ -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()
|
||||
|
|
@ -79,6 +79,9 @@ class LDownloaderApp(tk.Tk):
|
|||
if not os.path.isfile(ico_path):
|
||||
ico_path = os.path.join(app_dir, "logo.ico")
|
||||
if os.path.isfile(ico_path):
|
||||
try:
|
||||
self.iconbitmap(default=ico_path)
|
||||
except Exception:
|
||||
try:
|
||||
self.iconbitmap(ico_path)
|
||||
except Exception:
|
||||
|
|
@ -86,15 +89,33 @@ class LDownloaderApp(tk.Tk):
|
|||
|
||||
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:
|
||||
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:
|
||||
try:
|
||||
raw = tk.PhotoImage(file=png_path)
|
||||
self.window_icon_img = raw
|
||||
self.iconphoto(True, raw)
|
||||
factor = max(1, raw.width() // 24)
|
||||
factor = max(1, raw.width() // 28)
|
||||
self.logo_img = raw.subsample(factor, factor)
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue