@@ -82,6 +82,7 @@ def __init__(self, CodeClass):
8282
8383 self .transparent = BooleanVar ()
8484 self .transparent .set (False )
85+ self .using_alpha = False
8586
8687 # Boolean for connection
8788
@@ -670,21 +671,21 @@ def toggle_transparency(self, event=None):
670671 setting_transparent = self .transparent .get ()
671672 try :
672673 if setting_transparent :
673- if SYSTEM == WINDOWS :
674+ try :
674675 alpha = "#000001" if SYSTEM == WINDOWS else "systemTransparent"
675676 self .text .config (background = alpha )
676677 self .linenumbers .config (background = alpha )
677678 self .console .config (background = alpha )
678679 self .root .wm_attributes ('-transparentcolor' , alpha )
679- else :
680+ except TclError :
680681 self .root .wm_attributes ("-alpha" , 0.8 )
681- else :
682- self .text . config ( background = colour_map [ 'background' ])
683- self .linenumbers .config (background = colour_map ['background' ])
684- self .console .config (background = "Black" )
685- if SYSTEM == WINDOWS :
682+ self . using_alpha = True
683+ elif not self .using_alpha :
684+ self .text .config (background = colour_map ['background' ])
685+ self .linenumbers .config (background = colour_map [ 'background' ] )
686+ self . console . config ( background = "Black" )
686687 self .root .wm_attributes ('-transparentcolor' , "" )
687- else :
688+ else :
688689 self .root .wm_attributes ("-alpha" , 1 )
689690 except TclError as e :
690691 print (e )
0 commit comments