aboutsummaryrefslogtreecommitdiff
path: root/git-gui/lib/search.tcl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-12 21:12:41 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-12 21:12:41 -0800
commit0f639abb68b29f6d4cd9b89ecfb66e41136dcfa3 (patch)
treec465f578f933c32dcbd1d8121665be64d6518c23 /git-gui/lib/search.tcl
parent171d7661eda111d3e35f6e8097a1a3a07b30026c (diff)
parentf75c8b319f5b448d8e7dc589ca581eec852a131e (diff)
downloadgit-0f639abb68b29f6d4cd9b89ecfb66e41136dcfa3.tar.gz
git-0f639abb68b29f6d4cd9b89ecfb66e41136dcfa3.tar.xz
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui: Request blame metadata in utf-8. git-gui: Add the Show SSH Key item to the clone dialog. git-gui: Fix focus transition in the blame viewer.
Diffstat (limited to 'git-gui/lib/search.tcl')
-rw-r--r--git-gui/lib/search.tcl14
1 files changed, 11 insertions, 3 deletions
diff --git a/git-gui/lib/search.tcl b/git-gui/lib/search.tcl
index d292f20f6..32c8656fc 100644
--- a/git-gui/lib/search.tcl
+++ b/git-gui/lib/search.tcl
@@ -19,11 +19,11 @@ constructor new {i_w i_text args} {
frame $w
label $w.l -text [mc Find:]
+ entry $w.ent -textvariable ${__this}::searchstring -background lightgreen
button $w.bn -text [mc Next] -command [cb find_next]
button $w.bp -text [mc Prev] -command [cb find_prev]
checkbutton $w.cs -text [mc Case-Sensitive] \
-variable ${__this}::casesensitive -command [cb _incrsearch]
- entry $w.ent -textvariable ${__this}::searchstring -background lightgreen
pack $w.l -side left
pack $w.cs -side right
pack $w.bp -side right
@@ -40,19 +40,27 @@ constructor new {i_w i_text args} {
}
method show {} {
- if {![winfo ismapped $w]} {
+ if {![visible $this]} {
grid $w
}
focus -force $w.ent
}
method hide {} {
- if {[winfo ismapped $w]} {
+ if {[visible $this]} {
focus $ctext
grid remove $w
}
}
+method visible {} {
+ return [winfo ismapped $w]
+}
+
+method editor {} {
+ return $w.ent
+}
+
method _get_new_anchor {} {
# use start of selection if it is visible,
# or the bounds of the visible area