@matheusbsbs / matheus-bagliano / commits / a0592d3f57
Fork 0

git-gui: Change main window layout to support wider screens

The layout is changed to have the file lists at the left (Unstaged Changes at the top, Staged Changes below it) and the diff window at the right (with the commit area below it). +----------+---------------------+ | Unstaged | Diff area | | | | | | | | | | +----------+ | | Staged | | | +---------------------+ | | Commit area | | | | +----------+---------------------+ The advantages are: - The height of the file lists can be adjusted independently to fit the files that they contain. - The diff viewer is higher. On wide screens it is ok that the main window is now generally wider, too. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Johannes Sixt committed Oct 10, 2007 at 20:50 UTC a0592d3f5746b41c60fee71dd8d2d27b5c813907
1 file changed +12 -11
git-gui.sh
+12 -11
@@ -1658,8 +1658,8 @@ proc do_quit {} {
1658 #
1659 set cfg_geometry [list]
1660 lappend cfg_geometry [wm geometry .]
1661 - lappend cfg_geometry [lindex [.vpane sash coord 0] 1]
1662 - lappend cfg_geometry [lindex [.vpane.files sash coord 0] 0]
1661 + lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
1662 + lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
1663 if {[catch {set rc_geometry $repo_config(gui.geometry)}]} {
1664 set rc_geometry {}
1665 }
@@ -2208,8 +2208,8 @@ pack .branch -side top -fill x
2208
2209 # -- Main Window Layout
2210 #
2211 -panedwindow .vpane -orient vertical
2212 -panedwindow .vpane.files -orient horizontal
2211 +panedwindow .vpane -orient horizontal
2212 +panedwindow .vpane.files -orient vertical
2213 .vpane add .vpane.files -sticky nsew -height 100 -width 200
2214 pack .vpane -anchor n -side top -fill both -expand 1
2215
@@ -2231,7 +2231,6 @@ pack .vpane.files.index.title -side top -fill x
2231 pack .vpane.files.index.sx -side bottom -fill x
2232 pack .vpane.files.index.sy -side right -fill y
2233 pack $ui_index -side left -fill both -expand 1
2234 -.vpane.files add .vpane.files.index -sticky nsew
2234
2235 # -- Working Directory File List
2236 #
@@ -2251,7 +2250,9 @@ pack .vpane.files.workdir.title -side top -fill x
2250 pack .vpane.files.workdir.sx -side bottom -fill x
2251 pack .vpane.files.workdir.sy -side right -fill y
2252 pack $ui_workdir -side left -fill both -expand 1
2253 +
2254 .vpane.files add .vpane.files.workdir -sticky nsew
2255 +.vpane.files add .vpane.files.index -sticky nsew
2256
2257 foreach i [list $ui_index $ui_workdir] {
2258 rmsel_tag $i
@@ -2264,8 +2265,8 @@ unset i
2265 frame .vpane.lower -height 300 -width 400
2266 frame .vpane.lower.commarea
2267 frame .vpane.lower.diff -relief sunken -borderwidth 1
2267 -pack .vpane.lower.commarea -side top -fill x
2268 -pack .vpane.lower.diff -side bottom -fill both -expand 1
2268 +pack .vpane.lower.diff -fill both -expand 1
2269 +pack .vpane.lower.commarea -side bottom -fill x
2270 .vpane add .vpane.lower -sticky nsew
2271
2272 # -- Commit Area Buttons
@@ -2591,11 +2592,11 @@ catch {
2592 set gm $repo_config(gui.geometry)
2593 wm geometry . [lindex $gm 0]
2594 .vpane sash place 0 \
2594 - [lindex [.vpane sash coord 0] 0] \
2595 - [lindex $gm 1]
2595 + [lindex $gm 1] \
2596 + [lindex [.vpane sash coord 0] 1]
2597 .vpane.files sash place 0 \
2597 - [lindex $gm 2] \
2598 - [lindex [.vpane.files sash coord 0] 1]
2598 + [lindex [.vpane.files sash coord 0] 0] \
2599 + [lindex $gm 2]
2600 unset gm
2601 }
2602