v1.8.63: blue scrollbars matching CTk theme across all tabs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chrome-storm-c442
2026-02-25 07:18:04 -05:00
parent 3a5d1b27fc
commit 327647f77e
6 changed files with 49 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import customtkinter as ctk
from core.grafana_client import GrafanaClient
from core.i18n import t
from core.icons import icon_text
from gui.tabs.query_tab import apply_dark_scrollbar_style
class GrafanaTab(ctk.CTkFrame):
@@ -23,6 +24,7 @@ class GrafanaTab(ctk.CTkFrame):
self._build_ui()
def _build_ui(self):
apply_dark_scrollbar_style()
# ── Header + Refresh ──
header_frame = ctk.CTkFrame(self, fg_color="transparent")
header_frame.pack(fill="x", padx=15, pady=(15, 5))
@@ -54,7 +56,7 @@ class GrafanaTab(ctk.CTkFrame):
self._dash_tree.column("folder", width=150, minwidth=80)
self._dash_tree.pack(side="left", fill="both", expand=True)
dash_scroll = ttk.Scrollbar(dash_frame, orient="vertical", command=self._dash_tree.yview)
dash_scroll = ttk.Scrollbar(dash_frame, orient="vertical", command=self._dash_tree.yview, style="Dark.Vertical.TScrollbar")
dash_scroll.pack(side="right", fill="y")
self._dash_tree.configure(yscrollcommand=dash_scroll.set)
@@ -79,7 +81,7 @@ class GrafanaTab(ctk.CTkFrame):
self._alerts_tree.column("severity", width=100, minwidth=60)
self._alerts_tree.pack(side="left", fill="both", expand=True)
alerts_scroll = ttk.Scrollbar(alerts_frame, orient="vertical", command=self._alerts_tree.yview)
alerts_scroll = ttk.Scrollbar(alerts_frame, orient="vertical", command=self._alerts_tree.yview, style="Dark.Vertical.TScrollbar")
alerts_scroll.pack(side="right", fill="y")
self._alerts_tree.configure(yscrollcommand=alerts_scroll.set)

View File

@@ -9,6 +9,7 @@ import customtkinter as ctk
from core.prometheus_client import PrometheusClient
from core.i18n import t
from core.icons import icon_text
from gui.tabs.query_tab import apply_dark_scrollbar_style
class PrometheusTab(ctk.CTkFrame):
@@ -21,6 +22,7 @@ class PrometheusTab(ctk.CTkFrame):
self._build_ui()
def _build_ui(self):
apply_dark_scrollbar_style()
# ── PromQL query section ──
query_frame = ctk.CTkFrame(self, fg_color="transparent")
query_frame.pack(fill="x", padx=15, pady=(15, 5))
@@ -78,7 +80,8 @@ class PrometheusTab(ctk.CTkFrame):
self._targets_tree.pack(side="left", fill="both", expand=True)
targets_scroll = ttk.Scrollbar(targets_frame, orient="vertical",
command=self._targets_tree.yview)
command=self._targets_tree.yview,
style="Dark.Vertical.TScrollbar")
targets_scroll.pack(side="right", fill="y")
self._targets_tree.configure(yscrollcommand=targets_scroll.set)

View File

@@ -18,6 +18,42 @@ from core.icons import icon_text
from core.sql_client import SQLClient
_TREE_THEME_APPLIED = False
_SCROLLBAR_THEME_APPLIED = False
def apply_dark_scrollbar_style():
"""Apply dark scrollbar styles globally. Safe to call multiple times."""
global _SCROLLBAR_THEME_APPLIED
if _SCROLLBAR_THEME_APPLIED:
return
_SCROLLBAR_THEME_APPLIED = True
style = ttk.Style()
style.configure(
"Dark.Vertical.TScrollbar",
background="#3B8ED0",
troughcolor="#2b2b2b",
bordercolor="#2b2b2b",
arrowcolor="#a8d4f0",
relief="flat",
)
style.map(
"Dark.Vertical.TScrollbar",
background=[("active", "#5BA3DB"), ("disabled", "#1F6AA5")],
arrowcolor=[("active", "#cce5f7"), ("disabled", "#1F6AA5")],
)
style.configure(
"Dark.Horizontal.TScrollbar",
background="#3B8ED0",
troughcolor="#2b2b2b",
bordercolor="#2b2b2b",
arrowcolor="#a8d4f0",
relief="flat",
)
style.map(
"Dark.Horizontal.TScrollbar",
background=[("active", "#5BA3DB"), ("disabled", "#1F6AA5")],
arrowcolor=[("active", "#cce5f7"), ("disabled", "#1F6AA5")],
)
def _apply_db_tree_theme():
@@ -77,6 +113,7 @@ def _apply_db_tree_theme():
style.layout("Results.Treeview", [
("Results.Treeview.treearea", {"sticky": "nswe"}),
])
apply_dark_scrollbar_style()
class QueryTab(ctk.CTkFrame):
@@ -146,7 +183,7 @@ class QueryTab(ctk.CTkFrame):
tree_container = tk.Frame(left_frame, bg="#1e1e1e")
tree_container.pack(fill="both", expand=True, padx=2, pady=(0, 2))
self._tree_scroll = ttk.Scrollbar(tree_container, orient="vertical")
self._tree_scroll = ttk.Scrollbar(tree_container, orient="vertical", style="Dark.Vertical.TScrollbar")
self._tree_scroll.pack(side="right", fill="y")
self._db_tree = ttk.Treeview(
@@ -224,10 +261,10 @@ class QueryTab(ctk.CTkFrame):
results_frame = ctk.CTkFrame(right_ctk, fg_color="transparent")
results_frame.pack(fill="both", expand=True, padx=8, pady=(4, 4))
self._res_xscroll = ttk.Scrollbar(results_frame, orient="horizontal")
self._res_xscroll = ttk.Scrollbar(results_frame, orient="horizontal", style="Dark.Horizontal.TScrollbar")
self._res_xscroll.pack(side="bottom", fill="x")
self._res_yscroll = ttk.Scrollbar(results_frame, orient="vertical")
self._res_yscroll = ttk.Scrollbar(results_frame, orient="vertical", style="Dark.Vertical.TScrollbar")
self._res_yscroll.pack(side="right", fill="y")
self._results_tree = ttk.Treeview(

View File

@@ -1,6 +1,6 @@
"""Version info for ServerManager."""
__version__ = "1.8.60"
__version__ = "1.8.63"
__app_name__ = "ServerManager"
__author__ = "aibot777"
__description__ = "Desktop GUI for managing remote servers"