summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/tlshell/tlshell.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/tlshell/tlshell.tcl')
-rwxr-xr-xMaster/texmf-dist/scripts/tlshell/tlshell.tcl29
1 files changed, 21 insertions, 8 deletions
diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl
index e0e10993713..a78f494655c 100755
--- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl
+++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl
@@ -2010,6 +2010,11 @@ proc set_fontscale {s} {
}
}
+proc zoom {n} {
+ if {$n <= 0} {set n 1}
+ set_fontscale [expr {$n*$::tkfontscale}]
+}
+
##### running external commands #####
# For capturing an external command, we need a separate output channel,
@@ -2179,14 +2184,22 @@ proc populate_main {} {
.mn.opt add cascade -label [__ "GUI font scaling"] \
-menu .mn.opt.fscale
menu .mn.opt.fscale
- foreach s {0.5 0.7 1 1.25 1.5 2 3 4 6 8} {
- if {$s eq $::tkfontscale} {
- set mlabel "$s *"
- } else {
- set mlabel $s
- }
- .mn.opt.fscale add command -label $mlabel \
- -command "set_fontscale $s"
+ foreach s {0.6 0.8 1 1.2 1.6 2 2.5 3 3.8 5 6 7.5 9} {
+ .mn.opt.fscale add command -label $s -command "set_fontscale $s"
+ }
+
+ # browser-style keyboard shortcuts for scaling
+ bind . <Control-KeyRelease-minus> {zoom 0.8}
+ bind . <Control-KeyRelease-equal> {zoom 1.25}
+ bind . <Control-Shift-KeyRelease-equal> {zoom 1.25}
+ bind . <Control-KeyRelease-plus> {zoom 1.25}
+ bind . <Control-KeyRelease-0> {set_fontscale 1}
+ if {$::tcl_platform(os) eq "Darwin"} {
+ bind . <Command-KeyRelease-minus> {zoom 0.8}
+ bind . <Command-KeyRelease-equal> {zoom 1.25}
+ bind . <Command-Shift-KeyRelease-equal> {zoom 1.25}
+ bind . <Command-KeyRelease-plus> {zoom 1.25}
+ bind . <Command-KeyRelease-0> {set_fontscale 1}
}