11from tkinter import *
2-
32from Infrastructure .MobberManager import MobberManager
43from Infrastructure .TimeOptionsManager import TimeOptionsManager
54from Frames .ScreenBlockerFrame import ScreenBlockerFrame
65from Frames .TransparentCountdownFrame import TransparentCountdownFrame
76
87
98class MobTimerController (Tk ):
10-
119 def __init__ (self , * args , ** kwargs ):
1210 Tk .__init__ (self , * args , ** kwargs )
1311
@@ -25,14 +23,46 @@ def __init__(self, *args, **kwargs):
2523 self .frames [F ] = frame
2624 frame .grid (row = 0 , column = 0 , sticky = "nsew" )
2725
28- self .show_frame ( ScreenBlockerFrame )
26+ self .show_screen_blocker_frame ( )
2927
3028 def show_frame (self , frame_class ):
3129 frame = self .frames [frame_class ]
3230 frame .tkraise ()
3331
3432 def show_screen_blocker_frame (self ):
33+ self .set_full_screen_always_on_top ()
3534 self .show_frame (ScreenBlockerFrame )
3635
3736 def show_transparent_countdown_frame (self ):
3837 self .show_frame (TransparentCountdownFrame )
38+ self .set_partial_screen_transparent ()
39+
40+ def get_current_window_geometry (self , pad ):
41+ return "{0}x{1}+0+0" .format (
42+ self .winfo_screenwidth () - pad , self .winfo_screenheight () - pad )
43+
44+ def disable_resizing (self ):
45+ self .resizable (0 , 0 )
46+
47+ def remove_title_bar (self ):
48+ self .overrideredirect (1 )
49+
50+ def set_always_on_top (self ):
51+ self .wm_attributes ("-topmost" , 1 )
52+
53+ def set_full_screen_always_on_top (self ):
54+ controller = self
55+ controller .geometry (self .get_current_window_geometry (0 ))
56+ # controller.bind('<Escape>', self.toggle_geometry)
57+ self .set_always_on_top ()
58+ self .remove_title_bar ()
59+ self .disable_resizing ()
60+
61+ def set_partial_screen_transparent (self ):
62+ geometry = '200x200+0+0'
63+ controller = self
64+ controller .geometry (geometry )
65+ # controller.bind('<Escape>', self.toggle_geometry)
66+ self .set_always_on_top ()
67+ self .remove_title_bar ()
68+ self .disable_resizing ()
0 commit comments