Tk Source Code

Artifact [51a5a9ef]
Login

Artifact 51a5a9ef92a1ea35e30522b6b7af6957caa95a67:

Attachment "fontchooser.patch" to ticket [2442314f] added by haertel 2008-12-18 03:51:00.
--- fontchooser.tcl	2008-12-17 20:32:00.000000000 +0000
+++ fontchooser.tcl.new	2008-12-17 20:30:58.000000000 +0000
@@ -138,10 +138,13 @@
         wm transient $S(W) [winfo toplevel $S(-parent)]
         wm geometry $S(W) 430x316
 
+        set scaling [tk scaling]
+        set sizeWidth [expr {int([string length [::msgcat::mc "&Size:"]] * $scaling)}] 
+
         set outer [::ttk::frame $S(W).outer -padding {10 10}]
         ::tk::AmpWidget ::ttk::label $S(W).font -text [::msgcat::mc "&Font:"]
         ::tk::AmpWidget ::ttk::label $S(W).style -text [::msgcat::mc "Font st&yle:"]
-        ::tk::AmpWidget ::ttk::label $S(W).size -text [::msgcat::mc "&Size:"]
+        ::tk::AmpWidget ::ttk::label $S(W).size -text [::msgcat::mc "&Size:"] -width $sizeWidth
         ttk::entry $S(W).efont -textvariable [namespace which -variable S](font)
         ttk::entry $S(W).estyle -textvariable [namespace which -variable S](style)
         ttk::entry $S(W).esize -textvariable [namespace which -variable S](size) \
@@ -298,13 +301,13 @@
         set S(size) $F(-size)
         set S(strike) $F(-overstrike)
         set S(under) $F(-underline)
-        set S(style) "Regular"
+        set S(style) [::msgcat::mc "Regular"]
         if {$F(-weight) eq "bold" && $F(-slant) eq "italic"} {
-            set S(style) "Bold Italic"
+            set S(style) [::msgcat::mc "Bold Italic"]
         } elseif {$F(-weight) eq "bold"} {
-            set S(style) "Bold"
+            set S(style) [::msgcat::mc "Bold"]
         } elseif {$F(-slant) eq "italic"} {
-            set S(style) "Italic"
+            set S(style) [::msgcat::mc "Italic"]
         }
 
         set S(first) 0