Revert Bad Label Style Change

This commit is contained in:
David Sangrey committed 2025-11-11 22:31:54 -05:00
1 parent 30da989bc5
commit b8fa0f841b
1 file changed
+4 -7
+4 -7
View File
@@ -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)