@@ -26,6 +26,8 @@ def __init__(self, *args, **kwargs):
2626 frame .grid (row = 0 , column = 0 , sticky = "nsew" )
2727 self .last_frame = None
2828 self .show_screen_blocker_frame ()
29+ self .frames [TransparentCountdownFrame ].bind ("<Enter>" , self .toggle_transparent_frame_position )
30+ self .transparent_frame_position = 0
2931
3032 def show_frame (self , frame_class ):
3133 switched_frames = False
@@ -66,6 +68,8 @@ def set_full_screen_always_on_top(self):
6668 self .disable_resizing ()
6769 top_left_screen = "+0+0"
6870 controller .geometry (top_left_screen )
71+
72+ controller .wait_visibility (controller )
6973 controller .attributes ("-alpha" , 1 )
7074
7175 def set_partial_screen_transparent (self ):
@@ -81,7 +85,27 @@ def set_partial_screen_transparent(self):
8185 window_width = int (screenwidth * 0.3 )
8286 window_height = int (screenheight * 0.3 )
8387 window_size = "{0}x{1}+0+0" .format (window_width , window_height )
84- bottom_left_screen = "+{}+{}" .format (screenwidth - window_width , screenheight - window_height )
8588 controller .geometry (window_size )
86- controller .geometry (bottom_left_screen )
8789 controller .attributes ("-alpha" , 0.3 )
90+ self .toggle_transparent_frame_position ()
91+
92+ def toggle_transparent_frame_position (self , e = None ):
93+ screenwidth = self .winfo_screenwidth ()
94+ screenheight = self .winfo_screenheight ()
95+
96+ controller = self
97+
98+ self .set_always_on_top ()
99+ self .remove_title_bar ()
100+ self .disable_resizing ()
101+
102+ window_width = int (screenwidth * 0.3 )
103+ window_height = int (screenheight * 0.3 )
104+
105+ if self .transparent_frame_position == 0 :
106+ self .transparent_frame_position = screenwidth - window_width
107+ else :
108+ self .transparent_frame_position = 0
109+
110+ bottom_left_screen = "+{}+{}" .format (self .transparent_frame_position , screenheight - window_height )
111+ controller .geometry (bottom_left_screen )
0 commit comments