texlive[58251] Master: Capitalization paper sizes; some computed

commits+siepo at tug.org commits+siepo at tug.org
Wed Mar 10 18:10:33 CET 2021


Revision: 58251
          http://tug.org/svn/texlive?view=revision&revision=58251
Author:   siepo
Date:     2021-03-10 18:10:33 +0100 (Wed, 10 Mar 2021)
Log Message:
-----------
Capitalization paper sizes; some computed column widths

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl
    trunk/Master/tlpkg/installer/install-tl-gui.tcl
    trunk/Master/tlpkg/tltcl/tltcl.tcl

Modified: trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl
===================================================================
--- trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2021-03-10 10:58:07 UTC (rev 58250)
+++ trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2021-03-10 17:10:33 UTC (rev 58251)
@@ -1493,7 +1493,6 @@
   .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 @@
     .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 <space> {toggle_pl_marked [.tlpl.pl focus] "#1"}
   bind .tlpl.pl <Return> {toggle_pl_marked [.tlpl.pl focus] "#1"}
@@ -1573,16 +1573,16 @@
 }
 
 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 @@
   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 @@
   .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 @@
   .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

Modified: trunk/Master/tlpkg/installer/install-tl-gui.tcl
===================================================================
--- trunk/Master/tlpkg/installer/install-tl-gui.tcl	2021-03-10 10:58:07 UTC (rev 58250)
+++ trunk/Master/tlpkg/installer/install-tl-gui.tcl	2021-03-10 17:10:33 UTC (rev 58251)
@@ -906,6 +906,7 @@
     .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 @@
   ppack .tlschm.cancel -in .tlschm.buts -side right
   bind .tlschm <Escape> {.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 @@
     $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 @@
   }
 
   # 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

Modified: trunk/Master/tlpkg/tltcl/tltcl.tcl
===================================================================
--- trunk/Master/tlpkg/tltcl/tltcl.tcl	2021-03-10 10:58:07 UTC (rev 58250)
+++ trunk/Master/tlpkg/tltcl/tltcl.tcl	2021-03-10 17:10:33 UTC (rev 58251)
@@ -180,7 +180,6 @@
     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 @@
 }
 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 {}] {
+    # '<pathname> set <item> <column>' 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 @@
   # 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



More information about the tex-live-commits mailing list.