git-gui: Don't delete scrollbars in console windows
If we have added a scrollbar to the console window because one direction has too much text to fit in the available screen space we should just keep the scrollbars. Its annoying to watch our horizontal scrollbar bounce in and out of the window as additional text is inserted into the widget and the need for the scrollbar comes and goes. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Sep 26, 2007 at 14:16 UTC
59213f60b7a3085732f76736e1826869994abf1a
1 file changed
+2
-8
lib/console.tcl
+2
-8
@@ -202,14 +202,8 @@ method done {ok} {
202
}
203
204
method _sb_set {sb orient first last} {
205
- if {$first == 0 && $last == 1} {
206
- if {[winfo exists $sb]} {
207
- destroy $sb
208
- }
209
- return
210
- }
211
-
205
if {![winfo exists $sb]} {
206
+ if {$first == $last || ($first == 0 && $last == 1)} return
207
if {$orient eq {h}} {
208
scrollbar $sb -orient h -command [list $w_t xview]
209
pack $sb -fill x -side bottom -before $w_t
@@ -218,7 +212,7 @@ method _sb_set {sb orient first last} {
212
pack $sb -fill y -side right -before $w_t
213
}
214
}
221
- catch {$sb set $first $last}
215
+ $sb set $first $last
216
}
217
218
}