From b8fa0f841bb7ea459dcb598dc59ce8f310c00d25 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 11 Nov 2025 22:31:54 -0500 Subject: [PATCH] Revert Bad Label Style Change --- myNotebook.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/myNotebook.py b/myNotebook.py index b488916a..ac7978a7 100644 --- a/myNotebook.py +++ b/myNotebook.py @@ -51,13 +51,10 @@ class Label(ttk.Label): """Custom ttk.Label class to fix some display issues.""" def __init__(self, master: ttk.Frame | None = None, **kw): - style = ttk.Style() - if sys.platform == 'win32': - custom_style = 'nb.TLabel' # Create or update a style to emulate the tk.Label colors - style.configure(custom_style, foreground=PAGEFG, background=PAGEBG) - else: - custom_style = 'TLabel' # Use the platform default ttk style - kw.setdefault('style', custom_style) + kw['foreground'] = kw.pop('foreground', PAGEFG if sys.platform == 'win32' + else ttk.Style().lookup('TLabel', 'foreground')) + kw['background'] = kw.pop('background', PAGEBG if sys.platform == 'win32' + else ttk.Style().lookup('TLabel', 'background')) super().__init__(master, **kw)