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,7 +8,7 @@ from tkinter import ttk
|
||||
import customtkinter as ctk
|
||||
from core.prometheus_client import PrometheusClient
|
||||
from core.i18n import t
|
||||
from core.icons import icon_text
|
||||
from core.icons import icon_text, make_icon_button, reconfigure_icon_button
|
||||
from gui.tabs.query_tab import apply_dark_scrollbar_style
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ class PrometheusTab(ctk.CTkFrame):
|
||||
self._query_entry.pack(side="left", fill="x", expand=True, padx=(0, 10))
|
||||
self._query_entry.bind("<Return>", lambda e: self._execute_query())
|
||||
|
||||
self._exec_btn = ctk.CTkButton(query_frame, text=icon_text("execute", t("prom_execute")), width=100,
|
||||
command=self._execute_query)
|
||||
self._exec_btn = make_icon_button(query_frame, "execute", t("prom_execute"), width=100,
|
||||
command=self._execute_query)
|
||||
self._exec_btn.pack(side="left")
|
||||
|
||||
# ── Query results ──
|
||||
@@ -59,8 +59,8 @@ class PrometheusTab(ctk.CTkFrame):
|
||||
font=ctk.CTkFont(size=14, weight="bold"), anchor="w")
|
||||
targets_label.pack(side="left")
|
||||
|
||||
self._refresh_btn = ctk.CTkButton(targets_header, text=icon_text("refresh", t("prom_refresh")), width=100,
|
||||
command=self._refresh_all)
|
||||
self._refresh_btn = make_icon_button(targets_header, "refresh", t("prom_refresh"), width=100,
|
||||
command=self._refresh_all)
|
||||
self._refresh_btn.pack(side="right")
|
||||
|
||||
targets_frame = ctk.CTkFrame(self, fg_color="transparent")
|
||||
@@ -201,8 +201,10 @@ class PrometheusTab(ctk.CTkFrame):
|
||||
except Exception as e:
|
||||
self.after(0, lambda: self._set_status(f"(error) {e}", "#ef4444"))
|
||||
finally:
|
||||
self.after(0, lambda: self._refresh_btn.configure(
|
||||
state="normal", text=icon_text("refresh", t("prom_refresh"))))
|
||||
self.after(0, lambda: (
|
||||
self._refresh_btn.configure(state="normal"),
|
||||
reconfigure_icon_button(self._refresh_btn, "refresh", t("prom_refresh")),
|
||||
))
|
||||
|
||||
threading.Thread(target=_do, daemon=True).start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user