Skip to content

Commit

Permalink
Add true full screen ability
Browse files Browse the repository at this point in the history
  • Loading branch information
Qirky committed Aug 5, 2019
1 parent c0603d2 commit 4cc604b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion FoxDot/lib/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.35
0.7.36
14 changes: 14 additions & 0 deletions FoxDot/lib/Workspace/Editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def check_versions():
self.listening_for_connections = BooleanVar()
self.listening_for_connections.set(False)

self.true_fullscreen_toggled = BooleanVar()
self.true_fullscreen_toggled.set(False)

# Boolean for showing auto-complete prompt

self.show_prompt = BooleanVar()
Expand Down Expand Up @@ -198,6 +201,7 @@ def check_versions():
self.text.bind("<BackSpace>", self.backspace)
self.text.bind("<Delete>", self.delete)
self.text.bind("<Tab>", self.tab)
self.text.bind("<Escape>", self.toggle_true_fullscreen)
self.text.bind("<Key>", self.keypress)

self.text.bind("<Button-{}>".format(2 if SYSTEM == MAC_OS else 3), self.show_popup)
Expand Down Expand Up @@ -420,6 +424,16 @@ def run(self):

return

def toggle_true_fullscreen(self, event=None, zoom=False):
""" Zoom the screen - close with Escape """
if self.root.attributes('-fullscreen'):
self.root.attributes('-fullscreen', 0)
self.true_fullscreen_toggled.set(False)
elif zoom:
self.root.attributes('-fullscreen', 1)
self.true_fullscreen_toggled.set(True)
return

def reload(self):
""" Reloads synths / samples """
return self.namespace['_reload_synths'].__call__()
Expand Down
1 change: 1 addition & 0 deletions FoxDot/lib/Workspace/MenuBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(self, master, visible=True):
editmenu.add_command(label="Export Console Log", command=self.root.export_console)
editmenu.add_command(label="Toggle Console", command=self.root.toggle_console)
editmenu.add_separator()
editmenu.add_checkbutton(label="Toggle Fullscreen", command=(lambda: self.root.toggle_true_fullscreen(zoom=True)), variable=self.root.true_fullscreen_toggled)
editmenu.add_command(label="Toggle Menu", command=self.root.toggle_menu, accelerator="Ctrl+M")
editmenu.add_checkbutton(label="Toggle Window Transparency", command=self.root.toggle_transparency, variable=self.root.transparent)
editmenu.add_checkbutton(label="Toggle Auto-fill Prompt", command=self.root.toggle_prompt, variable=self.root.show_prompt)
Expand Down

0 comments on commit 4cc604b

Please sign in to comment.