@matheusbsbs / matheus-bagliano / commits / 3cb1f9c982
Fork 0

gitk: Fix errors in the theme patch

This fixes a typo in the commit selection combobox that prevented it from working properly, and sets the width of the widget. This also fixes show_error to handle errors arising before the gui is fully configured (ie: invalid command line parameters) Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Paul Mackerras <paulus@samba.org>

Pat Thoyts committed May 12, 2009 at 15:45 UTC 3cb1f9c9820357812a9f17df92008c8838cbc1fc
1 file changed +8 -2
gitk
+8 -2
@@ -1798,6 +1798,7 @@ proc make_transient {window origin} {
1798
1799 proc show_error {w top msg} {
1800 global NS
1801 + if {![info exists NS]} {set NS ""}
1802 if {[wm state $top] eq "withdrawn"} { wm deiconify $top }
1803 message $w.m -text $msg -justify center -aspect 400
1804 pack $w.m -side top -fill x -padx 20 -pady 20
@@ -1920,7 +1921,12 @@ proc mca {str} {
1921 proc makedroplist {w varname args} {
1922 global use_ttk
1923 if {$use_ttk} {
1923 - set gm [ttk::combobox $w -width 10 -state readonly\
1924 + set width 0
1925 + foreach label $args {
1926 + set cx [string length $label]
1927 + if {$cx > $width} {set width $cx}
1928 + }
1929 + set gm [ttk::combobox $w -width $width -state readonly\
1930 -textvariable $varname -values $args]
1931 } else {
1932 set gm [eval [linsert $args 0 tk_optionMenu $w $varname]]
@@ -2141,7 +2147,7 @@ proc makewindow {} {
2147 pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
2148 -side left -fill y
2149 set gdttype [mc "containing:"]
2144 - set gm [makedroplist .tf.lbar.gdttype gdtype \
2150 + set gm [makedroplist .tf.lbar.gdttype gdttype \
2151 [mc "containing:"] \
2152 [mc "touching paths:"] \
2153 [mc "adding/removing string:"]]