Backport full screen toggle from Tcl/Tk edition
This commit is contained in:
parent
aea7361779
commit
d43c9c6029
4
NEWS.md
4
NEWS.md
|
@ -7,8 +7,8 @@ Ported to Tcl/Tk.
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
* Application icon
|
* Application icon
|
||||||
* Full screen toggle (only in Tcl/Tk version)
|
* Full screen toggle
|
||||||
* Console toggle (only in Tcl/Tk version)
|
* Console support (only in Tcl/Tk version)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
10
scrunch2.py
10
scrunch2.py
|
@ -44,7 +44,7 @@ else:
|
||||||
|
|
||||||
about_text = """
|
about_text = """
|
||||||
A two-pane outliner
|
A two-pane outliner
|
||||||
Version 2.1a (10 December 2022)
|
Version 2.1a (11 December 2022)
|
||||||
MIT License
|
MIT License
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -660,6 +660,9 @@ def reset_font():
|
||||||
font_size = default_font_size
|
font_size = default_font_size
|
||||||
editor.configure(font="Courier " + str(font_size))
|
editor.configure(font="Courier " + str(font_size))
|
||||||
|
|
||||||
|
def full_screen():
|
||||||
|
top.attributes("-fullscreen", not top.attributes("-fullscreen"))
|
||||||
|
|
||||||
def show_about():
|
def show_about():
|
||||||
showinfo("About Scrunch Edit", about_text, parent=top)
|
showinfo("About Scrunch Edit", about_text, parent=top)
|
||||||
|
|
||||||
|
@ -802,6 +805,10 @@ view_menu.add_command(
|
||||||
view_menu.add_command(
|
view_menu.add_command(
|
||||||
label="Reset font", underline=0, accelerator="Ctrl-0",
|
label="Reset font", underline=0, accelerator="Ctrl-0",
|
||||||
command=reset_font)
|
command=reset_font)
|
||||||
|
view_menu.add_separator()
|
||||||
|
view_menu.add_command(
|
||||||
|
label="Full screen", underline=10, accelerator="F11",
|
||||||
|
command=full_screen)
|
||||||
|
|
||||||
section_menu = Menu(menubar)
|
section_menu = Menu(menubar)
|
||||||
menubar.add_cascade(menu=section_menu, label="Section", underline=0)
|
menubar.add_cascade(menu=section_menu, label="Section", underline=0)
|
||||||
|
@ -924,6 +931,7 @@ top.bind("<Command-greater>", lambda e: unfold_all())
|
||||||
top.bind("<Command-minus>", lambda e: make_font_smaller())
|
top.bind("<Command-minus>", lambda e: make_font_smaller())
|
||||||
top.bind("<Command-equal>", lambda e: make_font_bigger())
|
top.bind("<Command-equal>", lambda e: make_font_bigger())
|
||||||
top.bind("<Command-Key-0>", lambda e: reset_font())
|
top.bind("<Command-Key-0>", lambda e: reset_font())
|
||||||
|
top.bind("<F11>", lambda e: full_screen())
|
||||||
|
|
||||||
top.protocol("WM_DELETE_WINDOW", handle_quit)
|
top.protocol("WM_DELETE_WINDOW", handle_quit)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user