diff --git a/theme.py b/theme.py index bfb76c55d..38be6638c 100644 --- a/theme.py +++ b/theme.py @@ -343,18 +343,18 @@ def _update_widget(self, widget: tk.Widget | tk.BitmapImage) -> None: # noqa: C elif 'cursor' in widget.keys() and str(widget['cursor']) not in ['', 'arrow']: # Hack - highlight widgets like HyperlinkLabel with a non-default cursor - if 'fg' not in attribs: - widget['foreground'] = self.current['highlight'] + if 'fg' not in attribs and 'foreground' in widget.keys(): + widget.configure(foreground=self.current['highlight']), if 'insertbackground' in widget.keys(): # tk.Entry widget['insertbackground'] = self.current['foreground'] - if 'bg' not in attribs: - widget['background'] = self.current['background'] + if 'bg' not in attribs and 'background' in widget.keys(): + widget.configure(background=self.current['background']) if 'highlightbackground' in widget.keys(): # tk.Entry widget['highlightbackground'] = self.current['background'] - if 'font' not in attribs: - widget['font'] = self.current['font'] + if 'font' not in attribs and 'font' in widget.keys(): + widget.configure(font=self.current['font']) elif 'activeforeground' in widget.keys(): # e.g. tk.Button, tk.Label, tk.Menu