Skip to content

Commit 3cb1f9c

Browse files
patthoytspaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent d93f171 commit 3cb1f9c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gitk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,7 @@ proc make_transient {window origin} {
17981798

17991799
proc show_error {w top msg} {
18001800
global NS
1801+
if {![info exists NS]} {set NS ""}
18011802
if {[wm state $top] eq "withdrawn"} { wm deiconify $top }
18021803
message $w.m -text $msg -justify center -aspect 400
18031804
pack $w.m -side top -fill x -padx 20 -pady 20
@@ -1920,7 +1921,12 @@ proc mca {str} {
19201921
proc makedroplist {w varname args} {
19211922
global use_ttk
19221923
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\
19241930
-textvariable $varname -values $args]
19251931
} else {
19261932
set gm [eval [linsert $args 0 tk_optionMenu $w $varname]]
@@ -2141,7 +2147,7 @@ proc makewindow {} {
21412147
pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
21422148
-side left -fill y
21432149
set gdttype [mc "containing:"]
2144-
set gm [makedroplist .tf.lbar.gdttype gdtype \
2150+
set gm [makedroplist .tf.lbar.gdttype gdttype \
21452151
[mc "containing:"] \
21462152
[mc "touching paths:"] \
21472153
[mc "adding/removing string:"]]

0 commit comments

Comments
 (0)