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:
16
gui/app.py
16
gui/app.py
@@ -11,7 +11,7 @@ from core.status_checker import StatusChecker
|
||||
from core.updater import UpdateChecker
|
||||
from core import i18n
|
||||
from core.i18n import t, LANGUAGES
|
||||
from core.icons import icon, TAB_ICONS
|
||||
from core.icons import icon, TAB_ICONS, ctk_icon
|
||||
from core.session_pool import SessionPool
|
||||
from gui.sidebar import Sidebar
|
||||
from gui.server_dialog import ServerDialog
|
||||
@@ -147,7 +147,11 @@ class App(ctk.CTk):
|
||||
header_bar.pack_propagate(False)
|
||||
|
||||
# Language selector
|
||||
self._lang_icon = ctk.CTkLabel(header_bar, text="\U0001f310", font=ctk.CTkFont(size=14), width=20)
|
||||
_lang_img = ctk_icon("globe", 18)
|
||||
self._lang_icon = ctk.CTkLabel(
|
||||
header_bar, text="" if _lang_img else "\U0001f310",
|
||||
image=_lang_img, font=ctk.CTkFont(size=14), width=20,
|
||||
)
|
||||
self._lang_icon.pack(side="right", padx=(5, 0))
|
||||
lang_values = list(LANGUAGES.values())
|
||||
current_display = LANGUAGES.get(i18n.get_language(), "English")
|
||||
@@ -159,16 +163,20 @@ class App(ctk.CTk):
|
||||
self.lang_menu.pack(side="right", padx=(5, 0))
|
||||
|
||||
# Check Updates button
|
||||
_sync_img = ctk_icon("refresh", 18)
|
||||
self._update_check_btn = ctk.CTkButton(
|
||||
header_bar, text="\u21bb", width=30, height=30,
|
||||
header_bar, text="" if _sync_img else "\u21bb",
|
||||
image=_sync_img, width=30, height=30,
|
||||
corner_radius=15, fg_color="#6b7280", hover_color="#4b5563",
|
||||
command=self._check_updates_manual,
|
||||
)
|
||||
self._update_check_btn.pack(side="right", padx=(5, 0))
|
||||
|
||||
# About button
|
||||
_info_img = ctk_icon("info", 18)
|
||||
self.about_btn = ctk.CTkButton(
|
||||
header_bar, text="ⓘ", width=30, height=30,
|
||||
header_bar, text="" if _info_img else "ⓘ",
|
||||
image=_info_img, width=30, height=30,
|
||||
corner_radius=15, fg_color="#6b7280", hover_color="#4b5563",
|
||||
command=self._show_about
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user