git-gui: Default selection to first matching ref

If we have specifications listed in our revision picker mega-widget
then we should default the selection within that widget to the first
ref available.  This way the user does not need to use the spacebar
to activate the selection of a ref within the box; instead they can
navigate up/down with the arrow keys and be done with it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
maint
Shawn O. Pearce 2007-07-08 21:29:54 -04:00
parent 02087abcce
commit 84d3d7b84c
1 changed files with 5 additions and 0 deletions

View File

@ -133,6 +133,7 @@ constructor new {path {title {}}} {
set i 0
foreach spec $spec_head {
if {[lindex $spec 0] eq $current_branch} {
$w_list selection clear 0 end
$w_list selection set $i
break
}
@ -312,6 +313,10 @@ method _rebuild {pat} {
$w_list insert end $txt
}
}
if {$cur_specs ne {}} {
$w_list selection clear 0 end
$w_list selection set 0
}

if {[$w_filter cget -state] ne $ste} {
$w_list configure -state $ste