From 2a0b7e92506a2ad8a63ce67b6da6b263f5442111 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Wed, 10 Mar 2021 17:10:33 +0000 Subject: Capitalization paper sizes; some computed column widths git-svn-id: svn://tug.org/texlive/trunk@58251 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/tlshell/tlshell.tcl | 15 ++++++++------- Master/tlpkg/installer/install-tl-gui.tcl | 9 ++++++--- Master/tlpkg/tltcl/tltcl.tcl | 16 +++++++++++++++- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl index 1b823efa199..dd06e4d1caf 100755 --- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl +++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl @@ -1493,7 +1493,6 @@ proc platforms_select {} { .tlpl.pl column stat -width [expr {$::cw * 3}] .tlpl.pl heading plat -text [__ "platform"] -anchor w .tlpl.pl column plat -width [expr {$::cw * 20}] - # tag for indicating changed entries .tlpl.pl tag configure "changed" -font bfont @@ -1504,6 +1503,7 @@ proc platforms_select {} { .tlpl.pl insert {} end -id $pname -values \ [list [mark_sym [dict get $::platforms $pname "cur"]] $pname] } + set_tree_col_width .tlpl.pl "plat" bind .tlpl.pl {toggle_pl_marked [.tlpl.pl focus] "#1"} bind .tlpl.pl {toggle_pl_marked [.tlpl.pl focus] "#1"} @@ -1573,16 +1573,16 @@ proc commit_papers {} { } proc papersize_advanced {} { - # dialog for settings papersize for: + # dialog for settings paper size for: # all | pdftex | dvipdfmx | context | dvips | psutils | xdvi # on windows, xdvi is omitted - # we also insert a non-existent engine to test handling of missing entries # we could have handled papers somewhat like the platforms dialog, # but radio buttons seem more natural, # and there are not enough items to worry about scrollability. # we create a grid with the radio buttons and a column 'changed'. - set ::papers(dummy) "" ; # dummy: see comment above + ## a non-existent engine 'dummy' to test handling of missing entries + #set ::papers(dummy) "" foreach nm {"pdftex" "dvipdfmx" "context" "dvips" "psutils" "xdvi"} { set ::papers($nm) "" } @@ -1634,8 +1634,8 @@ proc papersize_advanced {} { pack [ttk::frame .tlpap.radios] -in .tlpap.bg foreach {p c} {"a4" 1 "letter" 2} { - pgrid [ttk::label .tlpap.radios.head$p -text $p -font bfont] \ - -row 0 -column $c + pgrid [ttk::label .tlpap.radios.head$p \ + -text [string totitle $p] -font bfont] -row 0 -column $c } grid [ttk::separator .tlpap.radios.sep0 -orient horizontal] \ -row 1 -column 0 -columnspan 3 -sticky ew @@ -2387,7 +2387,7 @@ proc populate_main {} { .mn.opt add cascade -label [__ "Paper ..."] -menu .mn.opt.paper incr inx menu .mn.opt.paper - foreach p {a4 letter} { + foreach p {A4 Letter} { .mn.opt.paper add command -label $p -command \ "set_all_papers [string tolower $p]" } @@ -2635,6 +2635,7 @@ proc populate_main {} { .pkglist heading remoterev -text [__ "Remote rev. (ver.)"] -anchor w .pkglist heading shortdesc -text [__ "Description"] -anchor w .pkglist column mk -width [expr {$::cw * 3}] -stretch 0 + # column widths are resizable: no need to accommodate the longest names .pkglist column name -width [expr {$::cw * 25}] -stretch 1 .pkglist column localrev -width [expr {$::cw * 18}] -stretch 0 .pkglist column remoterev -width [expr {$::cw * 18}] -stretch 0 diff --git a/Master/tlpkg/installer/install-tl-gui.tcl b/Master/tlpkg/installer/install-tl-gui.tcl index a8b5c0415c1..285cfc83af9 100755 --- a/Master/tlpkg/installer/install-tl-gui.tcl +++ b/Master/tlpkg/installer/install-tl-gui.tcl @@ -906,6 +906,7 @@ proc select_binaries {} { .tlbin.lst insert {} end -id $b -values \ [list [mark_sym $::vars($bb)] [__ $::bin_descs($b)]] } + set_tree_col_width .tlbin.lst "desc" pgrid .tlbin.lst -in .tlbin.binsf -row 0 -column 0 -sticky news pgrid .tlbin.binsc -in .tlbin.binsf -row 0 -column 1 -sticky ns grid columnconfigure .tlbin.binsf 0 -weight 1 @@ -955,14 +956,14 @@ proc select_scheme {} { ppack .tlschm.cancel -in .tlschm.buts -side right bind .tlschm {.tlschm.cancel invoke} - # schemes list + # schemes list. use treeview rather than listbox for uniform formatting ttk::treeview .tlschm.lst -columns {desc} -show {} -selectmode browse \ -height [llength $::schemes_order] - .tlschm.lst column "desc" -stretch 1; # -minwidth $max_width ppack .tlschm.lst -in .tlschm.bg -fill both -expand 1 foreach s $::schemes_order { .tlschm.lst insert {} end -id $s -values [list [__ $::scheme_descs($s)]] } + set_tree_col_width .tlschm.lst "desc" # we already made sure that $::vars(selected_scheme) has a valid value .tlschm.lst selection set [list $::vars(selected_scheme)] @@ -1087,6 +1088,8 @@ proc select_collections {} { $wgt insert {} end -id $c -values \ [list [mark_sym $::vars($c)] [__ $::coll_descs($c)]] } + set_tree_col_width .tlcoll.lang "desc" + set_tree_col_width .tlcoll.other "desc" wm protocol .tlcoll WM_DELETE_WINDOW \ {cancel_or_destroy .tlcoll.cancel .tlcoll} @@ -1595,7 +1598,7 @@ proc run_menu {} { } # instopt_letter - set ::lpapers {"A4" "letter"} + set ::lpapers {"A4" "Letter"} incr rw pgrid [ttk::label .paperl -text [__ "Default paper size"]] \ -in $curf -row $rw -column 0 -sticky w diff --git a/Master/tlpkg/tltcl/tltcl.tcl b/Master/tlpkg/tltcl/tltcl.tcl index 6c673ddee3f..b39959013ef 100644 --- a/Master/tlpkg/tltcl/tltcl.tcl +++ b/Master/tlpkg/tltcl/tltcl.tcl @@ -180,7 +180,6 @@ proc normalize_argv {} { set s [lindex $::argv $i] if {[string range $s 0 1] eq "--"} { set s [string range $s 1 end] - #set ::argv [lreplace $::argv $i $i $s] lset ::argv $i $s } set j [string first "=" $s] @@ -196,6 +195,20 @@ proc normalize_argv {} { } normalize_argv +# set width of a treeview column wide enough +# to fully display all entries +proc set_tree_col_width {tv cl} { + set len 0 + foreach c [$tv children {}] { + # ' set ' without a value parameter + # is really a get. + # Tree cells are set to use TkDefaultFont redo_fonts further down. + set l [font measure TkDefaultFont [$tv set $c $cl]] + if {$l > $len} {set len $l} + } + $tv column $cl -width [expr {$len+10}] +} + # localization support # for the sake of our translators we use our own translation function @@ -419,6 +432,7 @@ proc redo_fonts {} { # height: assume height == width*2 # workaround for treeview on windows on HiDPI displays ttk::style configure Treeview -rowheight [expr {3 * $::cw}] + ttk::style configure Cell -font TkDefaultFont # no bold text for messages; `userDefault' indicates priority option add *Dialog.msg.font TkDefaultFont userDefault -- cgit v1.2.3