mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-12 15:27:14 +03:00
theme.py: Apply .configure() paranoia on button enter/leave
This commit is contained in:
parent
17530c2d2b
commit
520ff5868f
28
theme.py
28
theme.py
@ -195,17 +195,35 @@ class _Theme(object):
|
||||
def _enter(self, event, image):
|
||||
widget = event.widget
|
||||
if widget and widget['state'] != tk.DISABLED:
|
||||
widget.configure(state=tk.ACTIVE)
|
||||
try:
|
||||
widget.configure(state=tk.ACTIVE)
|
||||
|
||||
except Exception:
|
||||
logger.exception(f'Failure setting widget active: {widget=}')
|
||||
|
||||
if image:
|
||||
image.configure(foreground=self.current['activeforeground'],
|
||||
background=self.current['activebackground'])
|
||||
try:
|
||||
image.configure(foreground=self.current['activeforeground'],
|
||||
background=self.current['activebackground'])
|
||||
|
||||
except Exception:
|
||||
logger.exception(f'Failure configuring image: {image=}')
|
||||
|
||||
def _leave(self, event, image):
|
||||
widget = event.widget
|
||||
if widget and widget['state'] != tk.DISABLED:
|
||||
widget.configure(state=tk.NORMAL)
|
||||
try:
|
||||
widget.configure(state=tk.NORMAL)
|
||||
|
||||
except Exception:
|
||||
logger.exception(f'Failure setting widget normal: {widget=}')
|
||||
|
||||
if image:
|
||||
image.configure(foreground=self.current['foreground'], background=self.current['background'])
|
||||
try:
|
||||
image.configure(foreground=self.current['foreground'], background=self.current['background'])
|
||||
|
||||
except Exception:
|
||||
logger.exception(f'Failure configuring image: {image=}')
|
||||
|
||||
# Set up colors
|
||||
def _colors(self, root, theme):
|
||||
|
Loading…
x
Reference in New Issue
Block a user