v1.9.1: PNG Material Design icons — 28 icons, dark/light theme, HiDPI, graceful Unicode fallback
- 56 PNG icons (28 unique × 2 color variants) from Material Design Icons (round style, 96×96px) - core/icons.py: ctk_icon(), make_icon_button(), reconfigure_icon_button() with CTkImage cache - Updated 15 GUI files: app.py, sidebar.py, server_dialog.py, all tabs - build.py: auto-include assets/icons/ in PyInstaller bundle, patch rollover at 99→minor+1 - tools/download_icons.py: icon download script - Automatic dark↔light theme switching via CTkImage dual-image support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import customtkinter as ctk
|
||||
from core.i18n import t
|
||||
from core.icons import (
|
||||
icon_text, TYPE_COLORS, TYPE_LABELS, CTX_ICONS, icon,
|
||||
make_icon_button, reconfigure_icon_button,
|
||||
)
|
||||
from gui.widgets.status_badge import StatusBadge
|
||||
|
||||
@@ -80,11 +81,11 @@ class Sidebar(ctk.CTkFrame):
|
||||
# Buttons
|
||||
btn_frame = ctk.CTkFrame(self, fg_color="transparent")
|
||||
btn_frame.pack(fill="x", padx=10, pady=10)
|
||||
self.add_btn = ctk.CTkButton(btn_frame, text=icon_text("add", t("add")), width=70, height=30, command=self._on_add)
|
||||
self.add_btn = make_icon_button(btn_frame, "add", t("add"), width=70, height=30, command=self._on_add)
|
||||
self.add_btn.pack(side="left", padx=(0, 3))
|
||||
self.edit_btn = ctk.CTkButton(btn_frame, text=icon_text("edit", t("edit")), width=70, height=30, fg_color="#6b7280", command=self._on_edit)
|
||||
self.edit_btn = make_icon_button(btn_frame, "edit", t("edit"), width=70, height=30, fg_color="#6b7280", command=self._on_edit)
|
||||
self.edit_btn.pack(side="left", padx=3)
|
||||
self.del_btn = ctk.CTkButton(btn_frame, text=icon_text("delete", t("delete")), width=70, height=30, fg_color="#ef4444", hover_color="#dc2626", command=self._on_delete)
|
||||
self.del_btn = make_icon_button(btn_frame, "delete", t("delete"), width=70, height=30, fg_color="#ef4444", hover_color="#dc2626", command=self._on_delete)
|
||||
self.del_btn.pack(side="right", padx=(3, 0))
|
||||
|
||||
# Callbacks — set by app.py
|
||||
@@ -103,9 +104,9 @@ class Sidebar(ctk.CTkFrame):
|
||||
def update_language(self):
|
||||
self.title_label.configure(text=t("servers"))
|
||||
self.search_entry.configure(placeholder_text=t("search"))
|
||||
self.add_btn.configure(text=icon_text("add", t("add")))
|
||||
self.edit_btn.configure(text=icon_text("edit", t("edit")))
|
||||
self.del_btn.configure(text=icon_text("delete", t("delete")))
|
||||
reconfigure_icon_button(self.add_btn, "add", t("add"))
|
||||
reconfigure_icon_button(self.edit_btn, "edit", t("edit"))
|
||||
reconfigure_icon_button(self.del_btn, "delete", t("delete"))
|
||||
self._update_sessions_label()
|
||||
|
||||
# ── Refresh / Render ──────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user