style(ui): redesign theme palette and header to match brushed titanium and frosted teal logo
This commit is contained in:
parent
b8133c31cb
commit
b1344c2c0d
3 changed files with 88 additions and 64 deletions
26
ui/app.py
26
ui/app.py
|
|
@ -113,7 +113,7 @@ class LDownloaderApp(tk.Tk):
|
||||||
if bbox:
|
if bbox:
|
||||||
pil_img = pil_img.crop(bbox)
|
pil_img = pil_img.crop(bbox)
|
||||||
self.logo_img = ImageTk.PhotoImage(
|
self.logo_img = ImageTk.PhotoImage(
|
||||||
pil_img.resize((30, 30), Image.Resampling.LANCZOS)
|
pil_img.resize((34, 34), Image.Resampling.LANCZOS)
|
||||||
)
|
)
|
||||||
if not ico_loaded or sys.platform != "win32":
|
if not ico_loaded or sys.platform != "win32":
|
||||||
for sz in (64, 48, 32, 16):
|
for sz in (64, 48, 32, 16):
|
||||||
|
|
@ -163,17 +163,31 @@ class LDownloaderApp(tk.Tk):
|
||||||
|
|
||||||
def _build_layout(self):
|
def _build_layout(self):
|
||||||
# ── Birleşik Üst Çubuk (Logo + Sekmeler + Durum) ────────────
|
# ── Birleşik Üst Çubuk (Logo + Sekmeler + Durum) ────────────
|
||||||
top_bar = tk.Frame(self, bg=TAB_BG, padx=24, pady=8)
|
top_bar = tk.Frame(self, bg=TAB_BG, padx=24, pady=9)
|
||||||
top_bar.pack(fill="x")
|
top_bar.pack(fill="x")
|
||||||
|
|
||||||
# Sol: Logo + Başlık
|
# Sol: Logo + Başlık + Sürüm Rozeti
|
||||||
brand_frame = tk.Frame(top_bar, bg=TAB_BG)
|
brand_frame = tk.Frame(top_bar, bg=TAB_BG)
|
||||||
brand_frame.pack(side="left", padx=(0, 24))
|
brand_frame.pack(side="left", padx=(0, 16))
|
||||||
|
|
||||||
if self.logo_img:
|
if self.logo_img:
|
||||||
tk.Label(brand_frame, image=self.logo_img, bg=TAB_BG).pack(side="left", padx=(0, 8))
|
tk.Label(brand_frame, image=self.logo_img, bg=TAB_BG).pack(side="left", padx=(0, 10))
|
||||||
|
|
||||||
tk.Label(brand_frame, text="LDownloader v3.5.0", font=FONT_TITLE, bg=TAB_BG, fg=TEXT).pack(side="left")
|
tk.Label(brand_frame, text="LDownloader", font=FONT_TITLE, bg=TAB_BG, fg=TEXT).pack(side="left")
|
||||||
|
tk.Label(
|
||||||
|
brand_frame,
|
||||||
|
text="v3.5",
|
||||||
|
font=FONT_SMALL_BOLD,
|
||||||
|
bg=ACCENT_MUTED,
|
||||||
|
fg=ACCENT_LIGHT,
|
||||||
|
padx=6,
|
||||||
|
pady=1,
|
||||||
|
highlightthickness=1,
|
||||||
|
highlightbackground=BORDER,
|
||||||
|
).pack(side="left", padx=(8, 0))
|
||||||
|
|
||||||
|
# Fırçalanmış metal dikey ayraç
|
||||||
|
tk.Frame(top_bar, bg=BORDER, width=1).pack(side="left", fill="y", padx=(0, 16), pady=4)
|
||||||
|
|
||||||
# Orta: Sekmeler
|
# Orta: Sekmeler
|
||||||
self.nav_buttons = {}
|
self.nav_buttons = {}
|
||||||
|
|
|
||||||
|
|
@ -388,16 +388,22 @@ class ScrollableFrame(tk.Frame):
|
||||||
|
|
||||||
|
|
||||||
class TabButton(tk.Frame):
|
class TabButton(tk.Frame):
|
||||||
"""Rounded-feel navigation item using a soft active-state surface."""
|
"""Rounded-feel navigation item using a brushed metallic & frosted teal active surface."""
|
||||||
def __init__(self, parent, icon, text, command=None, is_active=False):
|
def __init__(self, parent, icon, text, command=None, is_active=False):
|
||||||
super().__init__(parent, bg=TAB_BG, cursor="hand2")
|
super().__init__(
|
||||||
|
parent,
|
||||||
|
bg=TAB_BG,
|
||||||
|
cursor="hand2",
|
||||||
|
highlightthickness=1,
|
||||||
|
highlightbackground=(BORDER if is_active else TAB_BG),
|
||||||
|
)
|
||||||
self.command = command
|
self.command = command
|
||||||
self.is_active = is_active
|
self.is_active = is_active
|
||||||
|
|
||||||
active_bg = TAB_ACTIVE if is_active else TAB_BG
|
active_bg = TAB_ACTIVE if is_active else TAB_BG
|
||||||
active_fg = ACCENT_LIGHT if is_active else SUBTEXT
|
active_fg = ACCENT_LIGHT if is_active else SUBTEXT
|
||||||
|
|
||||||
self.content = tk.Frame(self, bg=active_bg, padx=15, pady=10)
|
self.content = tk.Frame(self, bg=active_bg, padx=14, pady=8)
|
||||||
self.content.pack(fill="both", expand=True)
|
self.content.pack(fill="both", expand=True)
|
||||||
|
|
||||||
self.lbl_icon = tk.Label(
|
self.lbl_icon = tk.Label(
|
||||||
|
|
@ -414,7 +420,7 @@ class TabButton(tk.Frame):
|
||||||
)
|
)
|
||||||
self.lbl_text.pack(side="left")
|
self.lbl_text.pack(side="left")
|
||||||
|
|
||||||
self.indicator = tk.Frame(self, bg=(ACCENT if is_active else TAB_BG), height=2)
|
self.indicator = tk.Frame(self, bg=(ACCENT_LIGHT if is_active else TAB_BG), height=3)
|
||||||
self.indicator.pack(fill="x", side="bottom")
|
self.indicator.pack(fill="x", side="bottom")
|
||||||
|
|
||||||
for w in (self, self.content, self.lbl_icon, self.lbl_text):
|
for w in (self, self.content, self.lbl_icon, self.lbl_text):
|
||||||
|
|
@ -431,10 +437,11 @@ class TabButton(tk.Frame):
|
||||||
bg_col = TAB_ACTIVE if active else TAB_BG
|
bg_col = TAB_ACTIVE if active else TAB_BG
|
||||||
fg_col = TEXT if active else SUBTEXT
|
fg_col = TEXT if active else SUBTEXT
|
||||||
icon_col = ACCENT_LIGHT if active else SUBTEXT
|
icon_col = ACCENT_LIGHT if active else SUBTEXT
|
||||||
ind_col = ACCENT if active else TAB_BG
|
ind_col = ACCENT_LIGHT if active else TAB_BG
|
||||||
|
bdr_col = BORDER if active else TAB_BG
|
||||||
font = FONT_BOLD if active else FONT_REGULAR
|
font = FONT_BOLD if active else FONT_REGULAR
|
||||||
|
|
||||||
self.config(bg=TAB_BG)
|
self.config(bg=TAB_BG, highlightbackground=bdr_col)
|
||||||
self.content.config(bg=bg_col)
|
self.content.config(bg=bg_col)
|
||||||
self.lbl_icon.config(bg=bg_col, fg=icon_col)
|
self.lbl_icon.config(bg=bg_col, fg=icon_col)
|
||||||
self.lbl_text.config(bg=bg_col, fg=fg_col, font=font)
|
self.lbl_text.config(bg=bg_col, fg=fg_col, font=font)
|
||||||
|
|
@ -442,26 +449,29 @@ class TabButton(tk.Frame):
|
||||||
|
|
||||||
def _enter(self):
|
def _enter(self):
|
||||||
if not self.is_active:
|
if not self.is_active:
|
||||||
|
self.config(highlightbackground=BORDER)
|
||||||
self.content.config(bg=TAB_HOVER)
|
self.content.config(bg=TAB_HOVER)
|
||||||
self.lbl_icon.config(bg=TAB_HOVER, fg=ACCENT_LIGHT)
|
self.lbl_icon.config(bg=TAB_HOVER, fg=ACCENT_LIGHT)
|
||||||
self.lbl_text.config(bg=TAB_HOVER, fg=TEXT)
|
self.lbl_text.config(bg=TAB_HOVER, fg=TEXT)
|
||||||
|
|
||||||
def _leave(self):
|
def _leave(self):
|
||||||
if not self.is_active:
|
if not self.is_active:
|
||||||
|
self.config(highlightbackground=TAB_BG)
|
||||||
self.content.config(bg=TAB_BG)
|
self.content.config(bg=TAB_BG)
|
||||||
self.lbl_icon.config(bg=TAB_BG, fg=SUBTEXT)
|
self.lbl_icon.config(bg=TAB_BG, fg=SUBTEXT)
|
||||||
self.lbl_text.config(bg=TAB_BG, fg=SUBTEXT)
|
self.lbl_text.config(bg=TAB_BG, fg=SUBTEXT)
|
||||||
|
|
||||||
|
|
||||||
class SegmentedPill(tk.Frame):
|
class SegmentedPill(tk.Frame):
|
||||||
"""Modern segmented buton denetleyicisi."""
|
"""Modern segmented buton denetleyicisi (fırçalanmış metal oyuk görünümü)."""
|
||||||
def __init__(self, parent, items, default_val=None, on_change=None, **kwargs):
|
def __init__(self, parent, items, default_val=None, on_change=None, **kwargs):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
bg=SURFACE_LIGHT,
|
bg=ENTRY_BG,
|
||||||
padx=3,
|
padx=3,
|
||||||
pady=3,
|
pady=3,
|
||||||
highlightthickness=0,
|
highlightthickness=1,
|
||||||
|
highlightbackground=BORDER,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
self.items = items
|
self.items = items
|
||||||
|
|
@ -475,7 +485,7 @@ class SegmentedPill(tk.Frame):
|
||||||
text=label,
|
text=label,
|
||||||
font=FONT_SMALL_BOLD,
|
font=FONT_SMALL_BOLD,
|
||||||
padx=14,
|
padx=14,
|
||||||
pady=7,
|
pady=6,
|
||||||
cursor="hand2"
|
cursor="hand2"
|
||||||
)
|
)
|
||||||
btn.pack(side="left", padx=1)
|
btn.pack(side="left", padx=1)
|
||||||
|
|
@ -498,7 +508,7 @@ class SegmentedPill(tk.Frame):
|
||||||
if k == self.selected_key:
|
if k == self.selected_key:
|
||||||
btn.config(bg=ACCENT, fg="#ffffff")
|
btn.config(bg=ACCENT, fg="#ffffff")
|
||||||
else:
|
else:
|
||||||
btn.config(bg=SURFACE_LIGHT, fg=SUBTEXT)
|
btn.config(bg=ENTRY_BG, fg=SUBTEXT)
|
||||||
|
|
||||||
def _hover_on(self, key):
|
def _hover_on(self, key):
|
||||||
if key != self.selected_key:
|
if key != self.selected_key:
|
||||||
|
|
@ -506,7 +516,7 @@ class SegmentedPill(tk.Frame):
|
||||||
|
|
||||||
def _hover_off(self, key):
|
def _hover_off(self, key):
|
||||||
if key != self.selected_key:
|
if key != self.selected_key:
|
||||||
self.buttons[key].config(bg=SURFACE_LIGHT, fg=SUBTEXT)
|
self.buttons[key].config(bg=ENTRY_BG, fg=SUBTEXT)
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
return self.selected_key
|
return self.selected_key
|
||||||
|
|
|
||||||
92
ui/theme.py
92
ui/theme.py
|
|
@ -4,54 +4,54 @@ from tkinter import ttk
|
||||||
|
|
||||||
_PALETTES = {
|
_PALETTES = {
|
||||||
"dark": {
|
"dark": {
|
||||||
"BG": "#0D1017",
|
"BG": "#111519",
|
||||||
"SURFACE": "#151923",
|
"SURFACE": "#1A2026",
|
||||||
"SURFACE_LIGHT": "#1E2433",
|
"SURFACE_LIGHT": "#232B33",
|
||||||
"SURFACE_HOVER": "#283044",
|
"SURFACE_HOVER": "#2D3741",
|
||||||
"ENTRY_BG": "#10141D",
|
"ENTRY_BG": "#13181C",
|
||||||
"BORDER": "#252D3D",
|
"BORDER": "#313C47",
|
||||||
"BORDER_FOCUS": "#8B7CFF",
|
"BORDER_FOCUS": "#6BC5B8",
|
||||||
"ACCENT": "#6C5CE7",
|
"ACCENT": "#3E9B8F",
|
||||||
"ACCENT_LIGHT": "#B2A4FF",
|
"ACCENT_LIGHT": "#8CE0D4",
|
||||||
"ACCENT_HOVER": "#5A4AD1",
|
"ACCENT_HOVER": "#338378",
|
||||||
"ACCENT_MUTED": "#23203F",
|
"ACCENT_MUTED": "#192B2B",
|
||||||
"ACCENT_GRADIENT": "#8B7CFF",
|
"ACCENT_GRADIENT": "#5CC0B3",
|
||||||
"TEXT": "#F3F5FA",
|
"TEXT": "#ECF1F5",
|
||||||
"SUBTEXT": "#9BA5B8",
|
"SUBTEXT": "#9AA6B2",
|
||||||
"MUTED": "#667185",
|
"MUTED": "#64707D",
|
||||||
"SUCCESS": "#2ED573",
|
"SUCCESS": "#38C998",
|
||||||
"SUCCESS_HOVER": "#25B360",
|
"SUCCESS_HOVER": "#2BA87D",
|
||||||
"WARNING": "#FFA502",
|
"WARNING": "#F0A830",
|
||||||
"ERROR": "#FF5252",
|
"ERROR": "#F05454",
|
||||||
"DANGER_HOVER": "#E04040",
|
"DANGER_HOVER": "#D43F3F",
|
||||||
"TAB_BG": "#11151E",
|
"TAB_BG": "#161B20",
|
||||||
"TAB_ACTIVE": "#23203F",
|
"TAB_ACTIVE": "#1B2E2F",
|
||||||
"TAB_HOVER": "#1B2130",
|
"TAB_HOVER": "#20272F",
|
||||||
},
|
},
|
||||||
"light": {
|
"light": {
|
||||||
"BG": "#F1F4F9",
|
"BG": "#E8EDF2",
|
||||||
"SURFACE": "#FFFFFF",
|
"SURFACE": "#F8FAFC",
|
||||||
"SURFACE_LIGHT": "#E9EEF6",
|
"SURFACE_LIGHT": "#E1E7EE",
|
||||||
"SURFACE_HOVER": "#DCE4F0",
|
"SURFACE_HOVER": "#D3DCE6",
|
||||||
"ENTRY_BG": "#F7F9FC",
|
"ENTRY_BG": "#FFFFFF",
|
||||||
"BORDER": "#D8E0EC",
|
"BORDER": "#C5CFD9",
|
||||||
"BORDER_FOCUS": "#635BFF",
|
"BORDER_FOCUS": "#2E857A",
|
||||||
"ACCENT": "#5850EC",
|
"ACCENT": "#2E857A",
|
||||||
"ACCENT_LIGHT": "#4338CA",
|
"ACCENT_LIGHT": "#1E665D",
|
||||||
"ACCENT_HOVER": "#463FD4",
|
"ACCENT_HOVER": "#236B62",
|
||||||
"ACCENT_MUTED": "#ECEBFF",
|
"ACCENT_MUTED": "#DDF2EE",
|
||||||
"ACCENT_GRADIENT": "#635BFF",
|
"ACCENT_GRADIENT": "#3E9B8F",
|
||||||
"TEXT": "#111827",
|
"TEXT": "#161C22",
|
||||||
"SUBTEXT": "#4B5563",
|
"SUBTEXT": "#4F5B67",
|
||||||
"MUTED": "#8E99AB",
|
"MUTED": "#7E8B98",
|
||||||
"SUCCESS": "#10B981",
|
"SUCCESS": "#159E72",
|
||||||
"SUCCESS_HOVER": "#059669",
|
"SUCCESS_HOVER": "#0E805B",
|
||||||
"WARNING": "#D97706",
|
"WARNING": "#C97A10",
|
||||||
"ERROR": "#EF4444",
|
"ERROR": "#DC3838",
|
||||||
"DANGER_HOVER": "#DC2626",
|
"DANGER_HOVER": "#B82828",
|
||||||
"TAB_BG": "#FFFFFF",
|
"TAB_BG": "#F3F6F9",
|
||||||
"TAB_ACTIVE": "#ECEBFF",
|
"TAB_ACTIVE": "#DDF2EE",
|
||||||
"TAB_HOVER": "#F3F4FF",
|
"TAB_HOVER": "#E8EEF3",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue