summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tltcl
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-11 03:01:03 +0000
committerNorbert Preining <norbert@preining.info>2021-04-11 03:01:03 +0000
commit9b552e1a4637af098a01847c97658f65bc505356 (patch)
tree5fdca147f23bfe92704e86bbcac8e13521185c6c /systems/texlive/tlnet/tlpkg/tltcl
parent5960076e4c9c15e2a052cf015dd697a65db3150d (diff)
CTAN sync 202104110301
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tltcl')
-rw-r--r--systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl50
1 files changed, 29 insertions, 21 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl b/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl
index 4e2288bef0..4ed73859cb 100644
--- a/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl
+++ b/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl
@@ -792,10 +792,14 @@ proc dirbrowser2widget {w} {
# on unix/linux the original indicators are hard-coded as bitmaps,
# which cannot scale with the rest of the interface.
-# the hack below replaces them with unicode characters.
+# the hack below replaces them with unicode characters, which are scaled
+# along with other text.
# This is implemented by removing the original indicators and prepending
# a unicode symbol and a unicode wide space to the text label.
+# The combobox down arrow and the treeview triangles (directory browser)
+# are still unscaled.
+
if $::plain_unix {
# from General Punctuation, 2000-206f
@@ -811,7 +815,7 @@ if $::plain_unix {
ttk::style layout TCheckbutton "Checkbutton.padding -sticky nswe -children {Checkbutton.focus -side left -sticky w -children {Checkbutton.label -sticky nswe}}"
ttk::style layout TRadiobutton "Radiobutton.padding -sticky nswe -children {Radiobutton.focus -side left -sticky w -children {Radiobutton.label -sticky nswe}}"
- proc tlupdate_check {w} {
+ proc tlupdate_check {w n e o} { ; # n, e, o added to keep trace happy
upvar [$w cget -variable] v
set s [$w cget -text]
set ck [expr {$v ? $::chk1 : $::chk0}]
@@ -821,35 +825,39 @@ if $::plain_unix {
} else {
set s "$ck$::wsp$s"
}
+ if {[string length $s] == 2} {
+ # indicator plus wide space plus empty string. Remove wide space.
+ set s [string range $s 0 0]
+ }
$w configure -text $s
- return $w
}
- bind TCheckbutton <ButtonRelease-1> {+tlupdate_check %W}
- bind TCheckbutton <Key-space> {+tlupdate_check %W}
- bind TCheckbutton <Map> {+tlupdate_check %W}
+ bind TCheckbutton <Map> {+tlupdate_check %W n e o}
+ bind TCheckbutton <Map> {+trace add variable [%W cget -variable] write \
+ [list tlupdate_check %W]}
+ bind TCheckbutton <Unmap> \
+ {+trace remove variable [%W cget -variable] write [list tlupdate_check %W]}
- proc tlupdate_radio {w} {
+ proc tlupdate_radio {w n e o} {
upvar [$w cget -variable] v
set ck [expr {$v eq [$w cget -value] ? $::rad1 : $::rad0}]
set s [$w cget -text]
set s0 [string index $s 0]
if {$s0 eq $::rad0 || $s0 eq $::rad1} {
- $w configure -text "$ck$::wsp[string range $s 2 end]"
+ set s "$ck$::wsp[string range $s 2 end]"
} else {
- $w configure -text "$ck$::wsp$s"
+ set s "$ck$::wsp$s"
}
- }
- proc tlupdate_radios {w} {
- upvar [$w cget -variable] v
- foreach sibling [winfo children [winfo parent $w]] {
- if {[winfo class $sibling] eq "TRadiobutton" &&
- [$sibling cget -variable] eq [$w cget -variable]
- && ![$sibling instate disabled]} {
- tlupdate_radio $sibling
- }
+ if {[string length $s] == 2} {
+ # indicator plus wide space plus empty string. Remove wide space.
+ set s [string range $s 0 0]
}
+ $w configure -text $s
}
- bind TRadiobutton <ButtonRelease-1> {+tlupdate_radios %W}
- bind TRadiobutton <Key-space> {+tlupdate_radios %W}
- bind TRadiobutton <Map> {+tlupdate_radio %W}
+
+ bind TRadiobutton <Map> {+tlupdate_radio %W n e o}
+ bind TRadiobutton <Map> {+trace add variable [%W cget -variable] write \
+ [list tlupdate_radio %W]}
+ bind TRadiobutton <Unmap> \
+ {+trace remove variable [%W cget -variable] write [list tlupdate_radio %W]}
}
+