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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user