From: Pat Thoyts Date: Wed, 10 Mar 2010 23:04:06 +0000 (+0000) Subject: gitk: Use the builtin panedwidget size management functions X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fpt%2Frestore-geometry;p=gitk gitk: Use the builtin panedwidget size management functions Since Tk 8.5 the paned widget can be told which panes should expand using the -stretch pane option. The ttk paned widget has a -weight option. This patch makes use of these rather than handling the configure event which currently causes the pane positions to creep during resizing and works very poorly when switching between zoomed and normal views on windows. Signed-off-by: Pat Thoyts --- diff --git a/gitk b/gitk index 7a17cd3..f919e84 100755 --- a/gitk +++ b/gitk @@ -2068,16 +2068,23 @@ proc makewindow {} { .tf.histframe.pwclist sashpos 1 [lindex $::geometry(pwsash1) 0] .tf.histframe.pwclist sashpos 0 [lindex $::geometry(pwsash0) 0] } + .tf.histframe.pwclist pane 0 -weight 1 } else { eval .tf.histframe.pwclist sash place 0 $geometry(pwsash0) eval .tf.histframe.pwclist sash place 1 $geometry(pwsash1) + if {$have_tk85} { + foreach pane [.tf.histframe.pwclist panes] { + .tf.histframe.pwclist paneconfigure $pane -stretch first + } + } else { + bind .tf.histframe.pwclist {resizeclistpanes %W %w} + } } # a scroll bar to rule them ${NS}::scrollbar $cscroll -command {allcanvs yview} if {!$use_ttk} {$cscroll configure -highlightthickness 0} pack $cscroll -side right -fill y - bind .tf.histframe.pwclist {resizeclistpanes %W %w} lappend bglist $canv $canv2 $canv3 pack .tf.histframe.pwclist -fill both -expand 1 -side left @@ -2360,6 +2367,9 @@ proc makewindow {} { bind %W {} %W sashpos 0 $::geometry(botwidth) } + .pwbottom pane 0 -weight 1 + } else { + bind .pwbottom {resizecdetpanes %W %w} } bind . { @@ -2368,7 +2378,6 @@ proc makewindow {} { } } - bind .pwbottom {resizecdetpanes %W %w} pack .ctop -fill both -expand 1 bindall <1> {selcanvline %W %x %y} #bindall {selcanvline %W %x %y}