Skip to content

Commit d962b8c

Browse files
committed
Transparent Time Window now jumps back and forth
1 parent 966b37d commit d962b8c

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

Frames/MobTimerController.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

Frames/TransparentCountdownFrame.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def __init__(self, parent, controller, time_options_manager, mobber_manager, cou
1111
self.mobber_manager.subscribe_to_mobber_list_change(self.mobber_list_change_callback)
1212
countdown_manager.subscribe_to_time_changes(self.update_time_change_callback)
1313

14+
1415
def update_time_change_callback(self, days, minutes, seconds):
1516
if days< 0 or minutes < 0 or seconds < 0:
1617
self.controller.show_screen_blocker_frame()
@@ -38,14 +39,14 @@ def create_frame_content(self):
3839
self.label_seconds.grid(row=row_index, column=2, sticky=W)
3940
row_index += 1
4041
self.label_driver = Label(self, text=self.get_driver_text(""), font="Helvetica 20 bold")
41-
self.label_driver.grid(row=row_index, columnspan=3, sticky=W)
42+
self.label_driver.grid(row=row_index, columnspan=3, sticky=E)
4243
row_index += 1
4344
self.label_navigator = Label(self, text=self.get_navigator_text(""), font="Helvetica 20 bold")
44-
self.label_navigator.grid(row=row_index, columnspan=3, sticky=W)
45+
self.label_navigator.grid(row=row_index, columnspan=3, sticky=E)
4546
row_index += 1
4647

4748
def get_navigator_text(self,name ):
48-
return "Navigator: " + name
49+
return "Next Driver: " + name
4950

5051
def get_driver_text(self, name):
51-
return "Driver: " + name
52+
return "Current Driver: " + name

build.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
C:\Python34\python setup.py py2exe
2+
pause

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from distutils.core import setup
2+
import py2exe, sys, os
3+
4+
sys.argv.append('py2exe')
5+
6+
setup(windows=['main.py'], data_files=['C:\\Python34\\tcl\\tcl8.6\\init.tcl'])

0 commit comments

Comments
 (0)