git-gui: Pad new branch name input box.
The new branch name input box was showing up too close to the labelframe border, it was basically right on top of it on Windows. This didn't look right when compared to the Starting Revision's expression input field, as that had a 5 pixel padding. So I've put the new name input box into its own frame and padded that frame by 5 pixels, making the UI more consistent. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 21, 2007 at 13:37 UTC
f8a1518d06378c34fa8a0d8530e5041527004af5
1 file changed
+17
-15
git-gui.sh
+17
-15
@@ -1683,7 +1683,7 @@ proc do_create_branch_action {w} {
1683
global create_branch_checkout create_branch_revtype
1684
global create_branch_head create_branch_trackinghead
1685
1686
- set newbranch [string trim [$w.name.t get 0.0 end]]
1686
+ set newbranch [string trim [$w.desc.name.t get 0.0 end]]
1687
if {![catch {exec git show-ref --verify -- "refs/heads/$newbranch"}]} {
1688
tk_messageBox \
1689
-icon error \
@@ -1691,7 +1691,7 @@ proc do_create_branch_action {w} {
1691
-title [wm title $w] \
1692
-parent $w \
1693
-message "Branch '$newbranch' already exists."
1694
- focus $w.name.t
1694
+ focus $w.desc.name.t
1695
return
1696
}
1697
if {[catch {exec git check-ref-format "heads/$newbranch"}]} {
@@ -1701,7 +1701,7 @@ proc do_create_branch_action {w} {
1701
-title [wm title $w] \
1702
-parent $w \
1703
-message "We do not like '$newbranch' as a branch name."
1704
- focus $w.name.t
1704
+ focus $w.desc.name.t
1705
return
1706
}
1707
@@ -1775,20 +1775,21 @@ proc do_create_branch {} {
1775
pack $w.buttons.cancel -side right -padx 5
1776
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
1777
1778
- labelframe $w.name \
1778
+ labelframe $w.desc \
1779
-text {Branch Description} \
1780
-font font_ui
1781
- label $w.name.l -text {Name:} -font font_ui
1782
- text $w.name.t \
1781
+ frame $w.desc.name
1782
+ label $w.desc.name.l -text {Name:} -font font_ui
1783
+ text $w.desc.name.t \
1784
-borderwidth 1 \
1785
-relief sunken \
1786
-height 1 \
1787
-width 40 \
1788
-font font_ui
1788
- bind $w.name.t <Shift-Key-Tab> "focus $w.postActions.checkout;break"
1789
- bind $w.name.t <Key-Tab> "focus $w.from.exp.t;break"
1790
- bind $w.name.t <Key-Return> "do_create_branch_action $w;break"
1791
- bind $w.name.t <Key> {
1789
+ bind $w.desc.name.t <Shift-Key-Tab> "focus $w.postActions.checkout;break"
1790
+ bind $w.desc.name.t <Key-Tab> "focus $w.from.exp.t;break"
1791
+ bind $w.desc.name.t <Key-Return> "do_create_branch_action $w;break"
1792
+ bind $w.desc.name.t <Key> {
1793
if {{%K} ne {BackSpace}
1794
&& {%K} ne {Tab}
1795
&& {%K} ne {Escape}
@@ -1797,9 +1798,10 @@ proc do_create_branch {} {
1798
if {[string first %A {~^:?*[}] >= 0} break
1799
}
1800
}
1800
- pack $w.name.l -side left -padx 5
1801
- pack $w.name.t -side left -fill x -expand 1
1802
- pack $w.name -anchor nw -fill x -pady 5 -padx 5
1801
+ pack $w.desc.name.l -side left -padx 5
1802
+ pack $w.desc.name.t -side left -fill x -expand 1
1803
+ pack $w.desc.name -padx 5 -fill x -expand 1
1804
+ pack $w.desc -anchor nw -fill x -pady 5 -padx 5
1805
1806
set all_trackings [list]
1807
foreach b [array names tracking_branches] {
@@ -1846,7 +1848,7 @@ proc do_create_branch {} {
1848
-height 1 \
1849
-width 50 \
1850
-font font_ui
1849
- bind $w.from.exp.t <Shift-Key-Tab> "focus $w.name.t;break"
1851
+ bind $w.from.exp.t <Shift-Key-Tab> "focus $w.desc.name.t;break"
1852
bind $w.from.exp.t <Key-Tab> "focus $w.postActions.checkout;break"
1853
bind $w.from.exp.t <Key-Return> "do_create_branch_action $w;break"
1854
pack $w.from.exp.r -side left
@@ -1866,7 +1868,7 @@ proc do_create_branch {} {
1868
pack $w.postActions.checkout -anchor nw
1869
pack $w.postActions -anchor nw -fill x -pady 5 -padx 5
1870
1869
- bind $w <Visibility> "grab $w; focus $w.name.t"
1871
+ bind $w <Visibility> "grab $w; focus $w.desc.name.t"
1872
bind $w <Key-Escape> "destroy $w"
1873
bind $w <Key-Return> "do_create_branch_action $w;break"
1874
wm title $w "[appname] ([reponame]): Create Branch"