From 2d7fd4b351e7c1ca26bb865b8f153582e8007629 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Wed, 25 May 2011 18:39:12 +0200 Subject: [PATCH] git-gui: use the weight feature for ttk's paned windows Signed-off-by: Bert Wesarg --- git-gui.sh | 13 +++++++------ lib/blame.tcl | 44 +++++++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 476ba77..fd26268 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3185,7 +3185,7 @@ pack .branch -side top -fill x ${NS}::panedwindow .vpane -orient horizontal ${NS}::panedwindow .vpane.files -orient vertical if {$use_ttk} { - .vpane add .vpane.files + .vpane add .vpane.files -weight 0 } else { .vpane add .vpane.files -sticky nsew -height 100 -width 200 } @@ -3232,11 +3232,12 @@ pack .vpane.files.workdir.sx -side bottom -fill x pack .vpane.files.workdir.sy -side right -fill y pack $ui_workdir -side left -fill both -expand 1 -.vpane.files add .vpane.files.workdir -.vpane.files add .vpane.files.index -if {!$use_ttk} { - .vpane.files paneconfigure .vpane.files.workdir -sticky news - .vpane.files paneconfigure .vpane.files.index -sticky news +if {$use_ttk} { + .vpane.files add .vpane.files.workdir -weight 1 + .vpane.files add .vpane.files.index -weight 1 +} else { + .vpane.files add .vpane.files.workdir -sticky news + .vpane.files add .vpane.files.index -sticky news } foreach i [list $ui_index $ui_workdir] { diff --git a/lib/blame.tcl b/lib/blame.tcl index aa8cc9a..10d69bd 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -119,19 +119,27 @@ constructor new {i_commit i_path i_jump} { pack $w_path -fill x -side right pack $w.header.path_l -side right - panedwindow $w.file_pane -orient vertical -borderwidth 0 -sashwidth 3 + ${NS}::panedwindow $w.file_pane -orient vertical frame $w.file_pane.out -relief flat -borderwidth 1 frame $w.file_pane.cm -relief sunken -borderwidth 1 - $w.file_pane add $w.file_pane.out \ - -sticky nsew \ - -minsize 100 \ - -height 100 \ - -width 100 - $w.file_pane add $w.file_pane.cm \ - -sticky nsew \ - -minsize 25 \ - -height 25 \ - -width 100 + if {$use_ttk} { + $w.file_pane add $w.file_pane.out \ + -weight 3 + $w.file_pane add $w.file_pane.cm \ + -weight 1 + } else { + $w.file_pane configure -borderwidth 0 -sashwidth 3 + $w.file_pane add $w.file_pane.out \ + -sticky nsew \ + -minsize 100 \ + -height 400 \ + -width 100 + $w.file_pane add $w.file_pane.cm \ + -sticky nsew \ + -minsize 25 \ + -height 25 \ + -width 100 + } set w_line $w.file_pane.out.linenumber_t text $w_line \ @@ -393,12 +401,14 @@ constructor new {i_commit i_path i_jump} { wm geometry $top $g update - set old_height [winfo height $w.file_pane] - $w.file_pane sash place 0 \ - [lindex [$w.file_pane sash coord 0] 0] \ - [expr {int($old_height * 0.80)}] - bind $w.file_pane \ - "if {{$w.file_pane} eq {%W}} {[cb _resize %h]}" + if {!$use_ttk} { + set old_height [winfo height $w.file_pane] + $w.file_pane sash place 0 \ + [lindex [$w.file_pane sash coord 0] 0] \ + [expr {int($old_height * 0.80)}] + bind $w.file_pane \ + "if {{$w.file_pane} eq {%W}} {[cb _resize %h]}" + } wm protocol $top WM_DELETE_WINDOW "destroy $top" bind $top [cb _handle_destroy %W] -- 2.11.4.GIT