@matheusbsbs / matheus-bagliano / commits / 7416bbc65c
Fork 0

git-gui: Use option database defaults to set the font

Rather than passing "-font font_ui" to every widget that we create we can instead reconfigure the option database for all widget classes to use our font_ui as the default widget font. This way Tk will automatically setup their defaults for us, and we can reduce the size of the application. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Apr 28, 2007 at 23:14 UTC 7416bbc65cbcc3db9cafe50b92c14193ac295dbe
1 file changed +114 -256
git-gui.sh
+114 -256
@@ -1918,8 +1918,7 @@ proc populate_branch_menu {} {
1918 -label $b \
1919 -command [list switch_branch $b] \
1920 -variable current_branch \
1921 - -value $b \
1922 - -font font_ui
1921 + -value $b
1922 lappend disable_on_lock \
1923 [list $m entryconf [$m index last] -state]
1924 }
@@ -2078,26 +2077,21 @@ proc do_create_branch {} {
2077
2078 frame $w.buttons
2079 button $w.buttons.create -text Create \
2081 - -font font_ui \
2080 -default active \
2081 -command [list do_create_branch_action $w]
2082 pack $w.buttons.create -side right
2083 button $w.buttons.cancel -text {Cancel} \
2086 - -font font_ui \
2084 -command [list destroy $w]
2085 pack $w.buttons.cancel -side right -padx 5
2086 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
2087
2091 - labelframe $w.desc \
2092 - -text {Branch Description} \
2093 - -font font_ui
2094 - label $w.desc.name_l -text {Name:} -font font_ui
2088 + labelframe $w.desc -text {Branch Description}
2089 + label $w.desc.name_l -text {Name:}
2090 entry $w.desc.name_t \
2091 -borderwidth 1 \
2092 -relief sunken \
2093 -width 40 \
2094 -textvariable create_branch_name \
2100 - -font font_ui \
2095 -validate key \
2096 -validatecommand {
2097 if {%d == 1 && [regexp {[~^:?*\[\0- ]} %S]} {return 0}
@@ -2107,14 +2101,11 @@ proc do_create_branch {} {
2101 grid columnconfigure $w.desc 1 -weight 1
2102 pack $w.desc -anchor nw -fill x -pady 5 -padx 5
2103
2110 - labelframe $w.from \
2111 - -text {Starting Revision} \
2112 - -font font_ui
2104 + labelframe $w.from -text {Starting Revision}
2105 radiobutton $w.from.head_r \
2106 -text {Local Branch:} \
2107 -value head \
2116 - -variable create_branch_revtype \
2117 - -font font_ui
2108 + -variable create_branch_revtype
2109 eval tk_optionMenu $w.from.head_m create_branch_head $all_heads
2110 grid $w.from.head_r $w.from.head_m -sticky w
2111 set all_trackings [all_tracking_branches]
@@ -2123,8 +2114,7 @@ proc do_create_branch {} {
2114 radiobutton $w.from.tracking_r \
2115 -text {Tracking Branch:} \
2116 -value tracking \
2126 - -variable create_branch_revtype \
2127 - -font font_ui
2117 + -variable create_branch_revtype
2118 eval tk_optionMenu $w.from.tracking_m \
2119 create_branch_trackinghead \
2120 $all_trackings
@@ -2136,22 +2126,19 @@ proc do_create_branch {} {
2126 radiobutton $w.from.tag_r \
2127 -text {Tag:} \
2128 -value tag \
2139 - -variable create_branch_revtype \
2140 - -font font_ui
2129 + -variable create_branch_revtype
2130 eval tk_optionMenu $w.from.tag_m create_branch_tag $all_tags
2131 grid $w.from.tag_r $w.from.tag_m -sticky w
2132 }
2133 radiobutton $w.from.exp_r \
2134 -text {Revision Expression:} \
2135 -value expression \
2147 - -variable create_branch_revtype \
2148 - -font font_ui
2136 + -variable create_branch_revtype
2137 entry $w.from.exp_t \
2138 -borderwidth 1 \
2139 -relief sunken \
2140 -width 50 \
2141 -textvariable create_branch_revexp \
2154 - -font font_ui \
2142 -validate key \
2143 -validatecommand {
2144 if {%d == 1 && [regexp {\s} %S]} {return 0}
@@ -2164,13 +2151,10 @@ proc do_create_branch {} {
2151 grid columnconfigure $w.from 1 -weight 1
2152 pack $w.from -anchor nw -fill x -pady 5 -padx 5
2153
2167 - labelframe $w.postActions \
2168 - -text {Post Creation Actions} \
2169 - -font font_ui
2154 + labelframe $w.postActions -text {Post Creation Actions}
2155 checkbutton $w.postActions.checkout \
2156 -text {Checkout after creation} \
2172 - -variable create_branch_checkout \
2173 - -font font_ui
2157 + -variable create_branch_checkout
2158 pack $w.postActions.checkout -anchor nw
2159 pack $w.postActions -anchor nw -fill x -pady 5 -padx 5
2160
@@ -2296,24 +2280,19 @@ proc do_delete_branch {} {
2280
2281 frame $w.buttons
2282 button $w.buttons.create -text Delete \
2299 - -font font_ui \
2283 -command [list do_delete_branch_action $w]
2284 pack $w.buttons.create -side right
2285 button $w.buttons.cancel -text {Cancel} \
2303 - -font font_ui \
2286 -command [list destroy $w]
2287 pack $w.buttons.cancel -side right -padx 5
2288 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
2289
2308 - labelframe $w.list \
2309 - -text {Local Branches} \
2310 - -font font_ui
2290 + labelframe $w.list -text {Local Branches}
2291 listbox $w.list.l \
2292 -height 10 \
2293 -width 70 \
2294 -selectmode extended \
2315 - -yscrollcommand [list $w.list.sby set] \
2316 - -font font_ui
2295 + -yscrollcommand [list $w.list.sby set]
2296 foreach h $all_heads {
2297 if {$h ne $current_branch} {
2298 $w.list.l insert end $h
@@ -2324,14 +2303,11 @@ proc do_delete_branch {} {
2303 pack $w.list.l -side left -fill both -expand 1
2304 pack $w.list -fill both -expand 1 -pady 5 -padx 5
2305
2327 - labelframe $w.validate \
2328 - -text {Delete Only If} \
2329 - -font font_ui
2306 + labelframe $w.validate -text {Delete Only If}
2307 radiobutton $w.validate.head_r \
2308 -text {Merged Into Local Branch:} \
2309 -value head \
2333 - -variable delete_branch_checktype \
2334 - -font font_ui
2310 + -variable delete_branch_checktype
2311 eval tk_optionMenu $w.validate.head_m delete_branch_head $all_heads
2312 grid $w.validate.head_r $w.validate.head_m -sticky w
2313 set all_trackings [all_tracking_branches]
@@ -2340,8 +2316,7 @@ proc do_delete_branch {} {
2316 radiobutton $w.validate.tracking_r \
2317 -text {Merged Into Tracking Branch:} \
2318 -value tracking \
2343 - -variable delete_branch_checktype \
2344 - -font font_ui
2319 + -variable delete_branch_checktype
2320 eval tk_optionMenu $w.validate.tracking_m \
2321 delete_branch_trackinghead \
2322 $all_trackings
@@ -2350,8 +2325,7 @@ proc do_delete_branch {} {
2325 radiobutton $w.validate.always_r \
2326 -text {Always (Do not perform merge checks)} \
2327 -value always \
2353 - -variable delete_branch_checktype \
2354 - -font font_ui
2328 + -variable delete_branch_checktype
2329 grid $w.validate.always_r -columnspan 2 -sticky w
2330 grid columnconfigure $w.validate 1 -weight 1
2331 pack $w.validate -anchor nw -fill x -pady 5 -padx 5
@@ -2578,8 +2552,7 @@ proc populate_fetch_menu {} {
2552 if {$enable} {
2553 $m add command \
2554 -label "Fetch from $r..." \
2581 - -command [list fetch_from $r] \
2582 - -font font_ui
2555 + -command [list fetch_from $r]
2556 }
2557 }
2558 }
@@ -2614,8 +2587,7 @@ proc populate_push_menu {} {
2587 }
2588 $m add command \
2589 -label "Push to $r..." \
2617 - -command [list push_to $r] \
2618 - -font font_ui
2590 + -command [list push_to $r]
2591 incr fast_count
2592 }
2593 }
@@ -2675,26 +2647,21 @@ proc do_push_anywhere {} {
2647
2648 frame $w.buttons
2649 button $w.buttons.create -text Push \
2678 - -font font_ui \
2650 -default active \
2651 -command [list start_push_anywhere_action $w]
2652 pack $w.buttons.create -side right
2653 button $w.buttons.cancel -text {Cancel} \
2683 - -font font_ui \
2654 -default normal \
2655 -command [list destroy $w]
2656 pack $w.buttons.cancel -side right -padx 5
2657 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
2658
2689 - labelframe $w.source \
2690 - -text {Source Branches} \
2691 - -font font_ui
2659 + labelframe $w.source -text {Source Branches}
2660 listbox $w.source.l \
2661 -height 10 \
2662 -width 70 \
2663 -selectmode extended \
2696 - -yscrollcommand [list $w.source.sby set] \
2697 - -font font_ui
2664 + -yscrollcommand [list $w.source.sby set]
2665 foreach h $all_heads {
2666 $w.source.l insert end $h
2667 if {$h eq $current_branch} {
@@ -2706,15 +2673,12 @@ proc do_push_anywhere {} {
2673 pack $w.source.l -side left -fill both -expand 1
2674 pack $w.source -fill both -expand 1 -pady 5 -padx 5
2675
2709 - labelframe $w.dest \
2710 - -text {Destination Repository} \
2711 - -font font_ui
2676 + labelframe $w.dest -text {Destination Repository}
2677 if {$all_remotes ne {}} {
2678 radiobutton $w.dest.remote_r \
2679 -text {Remote:} \
2680 -value remote \
2716 - -variable push_urltype \
2717 - -font font_ui
2681 + -variable push_urltype
2682 eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes
2683 grid $w.dest.remote_r $w.dest.remote_m -sticky w
2684 if {[lsearch -sorted -exact $all_remotes origin] != -1} {
@@ -2729,14 +2693,12 @@ proc do_push_anywhere {} {
2693 radiobutton $w.dest.url_r \
2694 -text {Arbitrary URL:} \
2695 -value url \
2732 - -variable push_urltype \
2733 - -font font_ui
2696 + -variable push_urltype
2697 entry $w.dest.url_t \
2698 -borderwidth 1 \
2699 -relief sunken \
2700 -width 50 \
2701 -textvariable push_url \
2739 - -font font_ui \
2702 -validate key \
2703 -validatecommand {
2704 if {%d == 1 && [regexp {\s} %S]} {return 0}
@@ -2749,18 +2711,14 @@ proc do_push_anywhere {} {
2711 grid columnconfigure $w.dest 1 -weight 1
2712 pack $w.dest -anchor nw -fill x -pady 5 -padx 5
2713
2752 - labelframe $w.options \
2753 - -text {Transfer Options} \
2754 - -font font_ui
2714 + labelframe $w.options -text {Transfer Options}
2715 checkbutton $w.options.thin \
2716 -text {Use thin pack (for slow network connections)} \
2757 - -variable push_thin \
2758 - -font font_ui
2717 + -variable push_thin
2718 grid $w.options.thin -columnspan 2 -sticky w
2719 checkbutton $w.options.tags \
2720 -text {Include tags} \
2762 - -variable push_tags \
2763 - -font font_ui
2721 + -variable push_tags
2722 grid $w.options.tags -columnspan 2 -sticky w
2723 grid columnconfigure $w.options 1 -weight 1
2724 pack $w.options -anchor nw -fill x -pady 5 -padx 5
@@ -2950,28 +2908,22 @@ proc do_local_merge {} {
2908
2909 frame $w.buttons
2910 button $w.buttons.visualize -text Visualize \
2953 - -font font_ui \
2911 -command [list visualize_local_merge $w]
2912 pack $w.buttons.visualize -side left
2913 button $w.buttons.create -text Merge \
2957 - -font font_ui \
2914 -command [list start_local_merge_action $w]
2915 pack $w.buttons.create -side right
2916 button $w.buttons.cancel -text {Cancel} \
2961 - -font font_ui \
2917 -command [list destroy $w]
2918 pack $w.buttons.cancel -side right -padx 5
2919 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
2920
2966 - labelframe $w.source \
2967 - -text {Source Branches} \
2968 - -font font_ui
2921 + labelframe $w.source -text {Source Branches}
2922 listbox $w.source.l \
2923 -height 10 \
2924 -width 70 \
2925 -selectmode extended \
2973 - -yscrollcommand [list $w.source.sby set] \
2974 - -font font_ui
2926 + -yscrollcommand [list $w.source.sby set]
2927 scrollbar $w.source.sby -command [list $w.source.l yview]
2928 pack $w.source.sby -side right -fill y
2929 pack $w.source.l -side left -fill both -expand 1
@@ -3106,8 +3058,7 @@ proc new_browser {commit} {
3058 -height 20 \
3059 -width 70 \
3060 -xscrollcommand [list $w.list.sbx set] \
3109 - -yscrollcommand [list $w.list.sby set] \
3110 - -font font_ui
3061 + -yscrollcommand [list $w.list.sby set]
3062 $w_list tag conf in_sel \
3063 -background [$w_list cget -foreground] \
3064 -foreground [$w_list cget -background]
@@ -3122,8 +3073,7 @@ proc new_browser {commit} {
3073 -anchor w \
3074 -justify left \
3075 -borderwidth 1 \
3125 - -relief sunken \
3126 - -font font_ui
3076 + -relief sunken
3077 pack $w.status -anchor w -side bottom -fill x
3078
3079 bind $w_list <Button-1> "browser_click 0 $w_list @%x,%y;break"
@@ -3403,8 +3353,7 @@ proc show_blame {commit path} {
3353 -anchor w \
3354 -justify left \
3355 -borderwidth 1 \
3406 - -relief sunken \
3407 - -font font_ui
3356 + -relief sunken
3357 pack $w.status -side bottom -fill x
3358
3359 frame $w.cm
@@ -3426,7 +3375,6 @@ proc show_blame {commit path} {
3375
3376 menu $w.ctxm -tearoff 0
3377 $w.ctxm add command -label "Copy Commit" \
3429 - -font font_ui \
3378 -command "blame_copycommit $w \$cursorW @\$cursorX,\$cursorY"
3379
3380 foreach i [list \
@@ -3928,7 +3876,6 @@ proc hook_failed_popup {hook msg} {
3876
3877 button $w.ok -text OK \
3878 -width 15 \
3931 - -font font_ui \
3879 -command "destroy $w"
3880 pack $w.ok -side bottom -anchor e -pady 10 -padx 10
3881
@@ -3977,13 +3924,10 @@ proc console_init {w} {
3924
3925 menu $w.ctxm -tearoff 0
3926 $w.ctxm add command -label "Copy" \
3980 - -font font_ui \
3927 -command "tk_textCopy $w.m.t"
3928 $w.ctxm add command -label "Select All" \
3983 - -font font_ui \
3929 -command "focus $w.m.t;$w.m.t tag add sel 0.0 end"
3930 $w.ctxm add command -label "Copy All" \
3986 - -font font_ui \
3931 -command "
3932 $w.m.t tag add sel 0.0 end
3933 tk_textCopy $w.m.t
@@ -3991,7 +3935,6 @@ proc console_init {w} {
3935 "
3936
3937 button $w.ok -text {Close} \
3994 - -font font_ui \
3938 -state disabled \
3939 -command "destroy $w"
3940 pack $w.ok -side bottom -anchor e -pady 10 -padx 10
@@ -4179,17 +4122,14 @@ proc do_stats {} {
4122 toplevel $w
4123 wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
4124
4182 - label $w.header -text {Database Statistics} \
4183 - -font font_uibold
4125 + label $w.header -text {Database Statistics}
4126 pack $w.header -side top -fill x
4127
4128 frame $w.buttons -border 1
4129 button $w.buttons.close -text Close \
4188 - -font font_ui \
4130 -default active \
4131 -command [list destroy $w]
4132 button $w.buttons.gc -text {Compress Database} \
4192 - -font font_ui \
4133 -default normal \
4134 -command "destroy $w;do_gc"
4135 pack $w.buttons.close -side right
@@ -4213,8 +4153,8 @@ proc do_stats {} {
4153 set value "$value[lindex $s 2]"
4154 }
4155
4216 - label $w.stat.l_$name -text "$label:" -anchor w -font font_ui
4217 - label $w.stat.v_$name -text $value -anchor w -font font_ui
4156 + label $w.stat.l_$name -text "$label:" -anchor w
4157 + label $w.stat.v_$name -text $value -anchor w
4158 grid $w.stat.l_$name $w.stat.v_$name -sticky we -padx {0 5}
4159 }
4160 pack $w.stat -pady 10 -padx 10
@@ -4515,7 +4455,6 @@ proc do_about {} {
4455
4456 frame $w.buttons
4457 button $w.buttons.close -text {Close} \
4518 - -font font_ui \
4458 -default active \
4459 -command [list destroy $w]
4460 pack $w.buttons.close -side right
@@ -4528,8 +4467,7 @@ $copyright" \
4467 -justify left \
4468 -anchor w \
4469 -borderwidth 1 \
4531 - -relief solid \
4532 - -font font_ui
4470 + -relief solid
4471 pack $w.desc -side top -fill x -padx 5 -pady 5
4472
4473 set v {}
@@ -4549,14 +4487,12 @@ $copyright" \
4487 -justify left \
4488 -anchor w \
4489 -borderwidth 1 \
4552 - -relief solid \
4553 - -font font_ui
4490 + -relief solid
4491 pack $w.vers -side top -fill x -padx 5 -pady 5
4492
4493 menu $w.ctxm -tearoff 0
4494 $w.ctxm add command \
4495 -label {Copy} \
4559 - -font font_ui \
4496 -command "
4497 clipboard clear
4498 clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
@@ -4600,26 +4536,21 @@ proc do_options {} {
4536
4537 frame $w.buttons
4538 button $w.buttons.restore -text {Restore Defaults} \
4603 - -font font_ui \
4539 -default normal \
4540 -command do_restore_defaults
4541 pack $w.buttons.restore -side left
4542 button $w.buttons.save -text Save \
4608 - -font font_ui \
4543 -default active \
4544 -command [list do_save_config $w]
4545 pack $w.buttons.save -side right
4546 button $w.buttons.cancel -text {Cancel} \
4613 - -font font_ui \
4547 -default normal \
4548 -command [list destroy $w]
4549 pack $w.buttons.cancel -side right -padx 5
4550 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
4551
4619 - labelframe $w.repo -text "[reponame] Repository" \
4620 - -font font_ui
4621 - labelframe $w.global -text {Global (All Repositories)} \
4622 - -font font_ui
4552 + labelframe $w.repo -text "[reponame] Repository"
4553 + labelframe $w.global -text {Global (All Repositories)}
4554 pack $w.repo -side left -fill both -expand 1 -pady 5 -padx 5
4555 pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5
4556
@@ -4645,35 +4576,32 @@ proc do_options {} {
4576 checkbutton $w.$f.$optid -text $text \
4577 -variable ${f}_config_new($name) \
4578 -onvalue true \
4648 - -offvalue false \
4649 - -font font_ui
4579 + -offvalue false
4580 pack $w.$f.$optid -side top -anchor w
4581 }
4582 i-* {
4583 regexp -- {-(\d+)\.\.(\d+)$} $type _junk min max
4584 frame $w.$f.$optid
4655 - label $w.$f.$optid.l -text "$text:" -font font_ui
4585 + label $w.$f.$optid.l -text "$text:"
4586 pack $w.$f.$optid.l -side left -anchor w -fill x
4587 spinbox $w.$f.$optid.v \
4588 -textvariable ${f}_config_new($name) \
4589 -from $min \
4590 -to $max \
4591 -increment 1 \
4662 - -width [expr {1 + [string length $max]}] \
4663 - -font font_ui
4592 + -width [expr {1 + [string length $max]}]
4593 bind $w.$f.$optid.v <FocusIn> {%W selection range 0 end}
4594 pack $w.$f.$optid.v -side right -anchor e -padx 5
4595 pack $w.$f.$optid -side top -anchor w -fill x
4596 }
4597 t {
4598 frame $w.$f.$optid
4670 - label $w.$f.$optid.l -text "$text:" -font font_ui
4599 + label $w.$f.$optid.l -text "$text:"
4600 entry $w.$f.$optid.v \
4601 -borderwidth 1 \
4602 -relief sunken \
4603 -width 20 \
4675 - -textvariable ${f}_config_new($name) \
4676 - -font font_ui
4604 + -textvariable ${f}_config_new($name)
4605 pack $w.$f.$optid.l -side left -anchor w
4606 pack $w.$f.$optid.v -side left -anchor w \
4607 -fill x -expand 1 \
@@ -4696,7 +4624,7 @@ proc do_options {} {
4624 [font configure $font -size]
4625
4626 frame $w.global.$name
4699 - label $w.global.$name.l -text "$text:" -font font_ui
4627 + label $w.global.$name.l -text "$text:"
4628 pack $w.global.$name.l -side left -anchor w -fill x
4629 eval tk_optionMenu $w.global.$name.family \
4630 global_config_new(gui.$font^^family) \
@@ -4704,8 +4632,7 @@ proc do_options {} {
4632 spinbox $w.global.$name.size \
4633 -textvariable global_config_new(gui.$font^^size) \
4634 -from 2 -to 80 -increment 1 \
4707 - -width 3 \
4708 - -font font_ui
4635 + -width 3
4636 bind $w.global.$name.size <FocusIn> {%W selection range 0 end}
4637 pack $w.global.$name.size -side right -anchor e
4638 pack $w.global.$name.family -side right -anchor e
@@ -5002,6 +4929,13 @@ catch {
4929 font create font_uibold
4930 font create font_diffbold
4931
4932 +foreach class {Button Checkbutton Entry Label
4933 + Labelframe Listbox Menu Message
4934 + Radiobutton Text} {
4935 + option add *$class.font font_ui
4936 +}
4937 +unset class
4938 +
4939 if {[is_Windows]} {
4940 set M1B Control
4941 set M1T Ctrl
@@ -5049,8 +4983,6 @@ set font_descs {
4983 }
4984 load_config 0
4985 apply_config
5052 -option add *Dialog.msg.font font_ui
5053 -option add *Button.font font_ui
4986
4987 ######################################################################
4988 ##
@@ -5098,18 +5030,18 @@ set ui_comm {}
5030 # -- Menu Bar
5031 #
5032 menu .mbar -tearoff 0
5101 -.mbar add cascade -label Repository -menu .mbar.repository -font font_ui
5102 -.mbar add cascade -label Edit -menu .mbar.edit -font font_ui
5033 +.mbar add cascade -label Repository -menu .mbar.repository
5034 +.mbar add cascade -label Edit -menu .mbar.edit
5035 if {[is_enabled branch]} {
5104 - .mbar add cascade -label Branch -menu .mbar.branch -font font_ui
5036 + .mbar add cascade -label Branch -menu .mbar.branch
5037 }
5038 if {[is_enabled multicommit] || [is_enabled singlecommit]} {
5107 - .mbar add cascade -label Commit -menu .mbar.commit -font font_ui
5039 + .mbar add cascade -label Commit -menu .mbar.commit
5040 }
5041 if {[is_enabled transport]} {
5110 - .mbar add cascade -label Merge -menu .mbar.merge -font font_ui
5111 - .mbar add cascade -label Fetch -menu .mbar.fetch -font font_ui
5112 - .mbar add cascade -label Push -menu .mbar.push -font font_ui
5042 + .mbar add cascade -label Merge -menu .mbar.merge
5043 + .mbar add cascade -label Fetch -menu .mbar.fetch
5044 + .mbar add cascade -label Push -menu .mbar.push
5045 }
5046 . configure -menu .mbar
5047
@@ -5119,93 +5051,76 @@ menu .mbar.repository
5051
5052 .mbar.repository add command \
5053 -label {Browse Current Branch} \
5122 - -command {new_browser $current_branch} \
5123 - -font font_ui
5054 + -command {new_browser $current_branch}
5055 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Browse \$current_branch\" ;#"
5056 .mbar.repository add separator
5057
5058 .mbar.repository add command \
5059 -label {Visualize Current Branch} \
5129 - -command {do_gitk $current_branch} \
5130 - -font font_ui
5060 + -command {do_gitk $current_branch}
5061 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Visualize \$current_branch\" ;#"
5062 .mbar.repository add command \
5063 -label {Visualize All Branches} \
5134 - -command {do_gitk --all} \
5135 - -font font_ui
5064 + -command {do_gitk --all}
5065 .mbar.repository add separator
5066
5067 if {[is_enabled multicommit]} {
5068 .mbar.repository add command -label {Database Statistics} \
5140 - -command do_stats \
5141 - -font font_ui
5069 + -command do_stats
5070
5071 .mbar.repository add command -label {Compress Database} \
5144 - -command do_gc \
5145 - -font font_ui
5072 + -command do_gc
5073
5074 .mbar.repository add command -label {Verify Database} \
5148 - -command do_fsck_objects \
5149 - -font font_ui
5075 + -command do_fsck_objects
5076
5077 .mbar.repository add separator
5078
5079 if {[is_Cygwin]} {
5080 .mbar.repository add command \
5081 -label {Create Desktop Icon} \
5156 - -command do_cygwin_shortcut \
5157 - -font font_ui
5082 + -command do_cygwin_shortcut
5083 } elseif {[is_Windows]} {
5084 .mbar.repository add command \
5085 -label {Create Desktop Icon} \
5161 - -command do_windows_shortcut \
5162 - -font font_ui
5086 + -command do_windows_shortcut
5087 } elseif {[is_MacOSX]} {
5088 .mbar.repository add command \
5089 -label {Create Desktop Icon} \
5166 - -command do_macosx_app \
5167 - -font font_ui
5090 + -command do_macosx_app
5091 }
5092 }
5093
5094 .mbar.repository add command -label Quit \
5095 -command do_quit \
5173 - -accelerator $M1T-Q \
5174 - -font font_ui
5096 + -accelerator $M1T-Q
5097
5098 # -- Edit Menu
5099 #
5100 menu .mbar.edit
5101 .mbar.edit add command -label Undo \
5102 -command {catch {[focus] edit undo}} \
5181 - -accelerator $M1T-Z \
5182 - -font font_ui
5103 + -accelerator $M1T-Z
5104 .mbar.edit add command -label Redo \
5105 -command {catch {[focus] edit redo}} \
5185 - -accelerator $M1T-Y \
5186 - -font font_ui
5106 + -accelerator $M1T-Y
5107 .mbar.edit add separator
5108 .mbar.edit add command -label Cut \
5109 -command {catch {tk_textCut [focus]}} \
5190 - -accelerator $M1T-X \
5191 - -font font_ui
5110 + -accelerator $M1T-X
5111 .mbar.edit add command -label Copy \
5112 -command {catch {tk_textCopy [focus]}} \
5194 - -accelerator $M1T-C \
5195 - -font font_ui
5113 + -accelerator $M1T-C
5114 .mbar.edit add command -label Paste \
5115 -command {catch {tk_textPaste [focus]; [focus] see insert}} \
5198 - -accelerator $M1T-V \
5199 - -font font_ui
5116 + -accelerator $M1T-V
5117 .mbar.edit add command -label Delete \
5118 -command {catch {[focus] delete sel.first sel.last}} \
5202 - -accelerator Del \
5203 - -font font_ui
5119 + -accelerator Del
5120 .mbar.edit add separator
5121 .mbar.edit add command -label {Select All} \
5122 -command {catch {[focus] tag add sel 0.0 end}} \
5207 - -accelerator $M1T-A \
5208 - -font font_ui
5123 + -accelerator $M1T-A
5124
5125 # -- Branch Menu
5126 #
@@ -5214,20 +5129,17 @@ if {[is_enabled branch]} {
5129
5130 .mbar.branch add command -label {Create...} \
5131 -command do_create_branch \
5217 - -accelerator $M1T-N \
5218 - -font font_ui
5132 + -accelerator $M1T-N
5133 lappend disable_on_lock [list .mbar.branch entryconf \
5134 [.mbar.branch index last] -state]
5135
5136 .mbar.branch add command -label {Delete...} \
5223 - -command do_delete_branch \
5224 - -font font_ui
5137 + -command do_delete_branch
5138 lappend disable_on_lock [list .mbar.branch entryconf \
5139 [.mbar.branch index last] -state]
5140
5141 .mbar.branch add command -label {Reset...} \
5229 - -command do_reset_hard \
5230 - -font font_ui
5142 + -command do_reset_hard
5143 lappend disable_on_lock [list .mbar.branch entryconf \
5144 [.mbar.branch index last] -state]
5145 }
@@ -5241,8 +5153,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
5153 -label {New Commit} \
5154 -command do_select_commit_type \
5155 -variable selected_commit_type \
5244 - -value new \
5245 - -font font_ui
5156 + -value new
5157 lappend disable_on_lock \
5158 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5159
@@ -5250,8 +5161,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
5161 -label {Amend Last Commit} \
5162 -command do_select_commit_type \
5163 -variable selected_commit_type \
5253 - -value amend \
5254 - -font font_ui
5164 + -value amend
5165 lappend disable_on_lock \
5166 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5167
@@ -5259,33 +5169,28 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
5169
5170 .mbar.commit add command -label Rescan \
5171 -command do_rescan \
5262 - -accelerator F5 \
5263 - -font font_ui
5172 + -accelerator F5
5173 lappend disable_on_lock \
5174 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5175
5176 .mbar.commit add command -label {Add To Commit} \
5268 - -command do_add_selection \
5269 - -font font_ui
5177 + -command do_add_selection
5178 lappend disable_on_lock \
5179 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5180
5181 .mbar.commit add command -label {Add Existing To Commit} \
5182 -command do_add_all \
5275 - -accelerator $M1T-I \
5276 - -font font_ui
5183 + -accelerator $M1T-I
5184 lappend disable_on_lock \
5185 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5186
5187 .mbar.commit add command -label {Unstage From Commit} \
5281 - -command do_unstage_selection \
5282 - -font font_ui
5188 + -command do_unstage_selection
5189 lappend disable_on_lock \
5190 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5191
5192 .mbar.commit add command -label {Revert Changes} \
5287 - -command do_revert_selection \
5288 - -font font_ui
5193 + -command do_revert_selection
5194 lappend disable_on_lock \
5195 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5196
@@ -5293,13 +5198,11 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
5198
5199 .mbar.commit add command -label {Sign Off} \
5200 -command do_signoff \
5296 - -accelerator $M1T-S \
5297 - -font font_ui
5201 + -accelerator $M1T-S
5202
5203 .mbar.commit add command -label Commit \
5204 -command do_commit \
5301 - -accelerator $M1T-Return \
5302 - -font font_ui
5205 + -accelerator $M1T-Return
5206 lappend disable_on_lock \
5207 [list .mbar.commit entryconf [.mbar.commit index last] -state]
5208 }
@@ -5309,13 +5212,11 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
5212 if {[is_enabled branch]} {
5213 menu .mbar.merge
5214 .mbar.merge add command -label {Local Merge...} \
5312 - -command do_local_merge \
5313 - -font font_ui
5215 + -command do_local_merge
5216 lappend disable_on_lock \
5217 [list .mbar.merge entryconf [.mbar.merge index last] -state]
5218 .mbar.merge add command -label {Abort Merge...} \
5317 - -command do_reset_hard \
5318 - -font font_ui
5219 + -command do_reset_hard
5220 lappend disable_on_lock \
5221 [list .mbar.merge entryconf [.mbar.merge index last] -state]
5222
@@ -5328,8 +5229,7 @@ if {[is_enabled transport]} {
5229
5230 menu .mbar.push
5231 .mbar.push add command -label {Push...} \
5331 - -command do_push_anywhere \
5332 - -font font_ui
5232 + -command do_push_anywhere
5233 }
5234
5235 if {[is_MacOSX]} {
@@ -5339,18 +5239,15 @@ if {[is_MacOSX]} {
5239 menu .mbar.apple
5240
5241 .mbar.apple add command -label "About [appname]" \
5342 - -command do_about \
5343 - -font font_ui
5242 + -command do_about
5243 .mbar.apple add command -label "Options..." \
5345 - -command do_options \
5346 - -font font_ui
5244 + -command do_options
5245 } else {
5246 # -- Edit Menu
5247 #
5248 .mbar.edit add separator
5249 .mbar.edit add command -label {Options...} \
5352 - -command do_options \
5353 - -font font_ui
5250 + -command do_options
5251
5252 # -- Tools Menu
5253 #
@@ -5376,8 +5273,7 @@ if {[is_MacOSX]} {
5273 .mbar add cascade -label Tools -menu .mbar.tools
5274 menu .mbar.tools
5275 .mbar.tools add command -label "Migrate" \
5379 - -command do_miga \
5380 - -font font_ui
5276 + -command do_miga
5277 lappend disable_on_lock \
5278 [list .mbar.tools entryconf [.mbar.tools index last] -state]
5279 }
@@ -5385,13 +5281,12 @@ if {[is_MacOSX]} {
5281
5282 # -- Help Menu
5283 #
5388 -.mbar add cascade -label Help -menu .mbar.help -font font_ui
5284 +.mbar add cascade -label Help -menu .mbar.help
5285 menu .mbar.help
5286
5287 if {![is_MacOSX]} {
5288 .mbar.help add command -label "About [appname]" \
5393 - -command do_about \
5394 - -font font_ui
5289 + -command do_about
5290 }
5291
5292 set browser {}
@@ -5428,8 +5323,7 @@ if {[file isfile $doc_path]} {
5323
5324 if {$browser ne {}} {
5325 .mbar.help add command -label {Online Documentation} \
5431 - -command [list exec $browser $doc_url &] \
5432 - -font font_ui
5326 + -command [list exec $browser $doc_url &]
5327 }
5328 unset browser doc_path doc_url
5329
@@ -5488,13 +5382,11 @@ frame .branch \
5382 label .branch.l1 \
5383 -text {Current Branch:} \
5384 -anchor w \
5491 - -justify left \
5492 - -font font_ui
5385 + -justify left
5386 label .branch.cb \
5387 -textvariable current_branch \
5388 -anchor w \
5496 - -justify left \
5497 - -font font_ui
5389 + -justify left
5390 pack .branch.l1 -side left
5391 pack .branch.cb -side left -fill x
5392 pack .branch -side top -fill x
@@ -5510,12 +5402,10 @@ pack .vpane -anchor n -side top -fill both -expand 1
5402 #
5403 frame .vpane.files.index -height 100 -width 200
5404 label .vpane.files.index.title -text {Changes To Be Committed} \
5513 - -background green \
5514 - -font font_ui
5405 + -background green
5406 text $ui_index -background white -borderwidth 0 \
5407 -width 20 -height 10 \
5408 -wrap none \
5518 - -font font_ui \
5409 -cursor $cursor_ptr \
5410 -xscrollcommand {.vpane.files.index.sx set} \
5411 -yscrollcommand {.vpane.files.index.sy set} \
@@ -5532,12 +5422,10 @@ pack $ui_index -side left -fill both -expand 1
5422 #
5423 frame .vpane.files.workdir -height 100 -width 200
5424 label .vpane.files.workdir.title -text {Changed But Not Updated} \
5535 - -background red \
5536 - -font font_ui
5425 + -background red
5426 text $ui_workdir -background white -borderwidth 0 \
5427 -width 20 -height 10 \
5428 -wrap none \
5540 - -font font_ui \
5429 -cursor $cursor_ptr \
5430 -xscrollcommand {.vpane.files.workdir.sx set} \
5431 -yscrollcommand {.vpane.files.workdir.sy set} \
@@ -5572,33 +5460,28 @@ pack .vpane.lower.diff -side bottom -fill both -expand 1
5460 frame .vpane.lower.commarea.buttons
5461 label .vpane.lower.commarea.buttons.l -text {} \
5462 -anchor w \
5575 - -justify left \
5576 - -font font_ui
5463 + -justify left
5464 pack .vpane.lower.commarea.buttons.l -side top -fill x
5465 pack .vpane.lower.commarea.buttons -side left -fill y
5466
5467 button .vpane.lower.commarea.buttons.rescan -text {Rescan} \
5581 - -command do_rescan \
5582 - -font font_ui
5468 + -command do_rescan
5469 pack .vpane.lower.commarea.buttons.rescan -side top -fill x
5470 lappend disable_on_lock \
5471 {.vpane.lower.commarea.buttons.rescan conf -state}
5472
5473 button .vpane.lower.commarea.buttons.incall -text {Add Existing} \
5588 - -command do_add_all \
5589 - -font font_ui
5474 + -command do_add_all
5475 pack .vpane.lower.commarea.buttons.incall -side top -fill x
5476 lappend disable_on_lock \
5477 {.vpane.lower.commarea.buttons.incall conf -state}
5478
5479 button .vpane.lower.commarea.buttons.signoff -text {Sign Off} \
5595 - -command do_signoff \
5596 - -font font_ui
5480 + -command do_signoff
5481 pack .vpane.lower.commarea.buttons.signoff -side top -fill x
5482
5483 button .vpane.lower.commarea.buttons.commit -text {Commit} \
5600 - -command do_commit \
5601 - -font font_ui
5484 + -command do_commit
5485 pack .vpane.lower.commarea.buttons.commit -side top -fill x
5486 lappend disable_on_lock \
5487 {.vpane.lower.commarea.buttons.commit conf -state}
@@ -5613,22 +5496,19 @@ radiobutton .vpane.lower.commarea.buffer.header.new \
5496 -text {New Commit} \
5497 -command do_select_commit_type \
5498 -variable selected_commit_type \
5616 - -value new \
5617 - -font font_ui
5499 + -value new
5500 lappend disable_on_lock \
5501 [list .vpane.lower.commarea.buffer.header.new conf -state]
5502 radiobutton .vpane.lower.commarea.buffer.header.amend \
5503 -text {Amend Last Commit} \
5504 -command do_select_commit_type \
5505 -variable selected_commit_type \
5624 - -value amend \
5625 - -font font_ui
5506 + -value amend
5507 lappend disable_on_lock \
5508 [list .vpane.lower.commarea.buffer.header.amend conf -state]
5509 label $ui_coml \
5510 -anchor w \
5630 - -justify left \
5631 - -font font_ui
5511 + -justify left
5512 proc trace_commit_type {varname args} {
5513 global ui_coml commit_type
5514 switch -glob -- $commit_type {
@@ -5667,28 +5547,22 @@ set ctxm .vpane.lower.commarea.buffer.ctxm
5547 menu $ctxm -tearoff 0
5548 $ctxm add command \
5549 -label {Cut} \
5670 - -font font_ui \
5550 -command {tk_textCut $ui_comm}
5551 $ctxm add command \
5552 -label {Copy} \
5674 - -font font_ui \
5553 -command {tk_textCopy $ui_comm}
5554 $ctxm add command \
5555 -label {Paste} \
5678 - -font font_ui \
5556 -command {tk_textPaste $ui_comm}
5557 $ctxm add command \
5558 -label {Delete} \
5682 - -font font_ui \
5559 -command {$ui_comm delete sel.first sel.last}
5560 $ctxm add separator
5561 $ctxm add command \
5562 -label {Select All} \
5687 - -font font_ui \
5563 -command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
5564 $ctxm add command \
5565 -label {Copy All} \
5691 - -font font_ui \
5566 -command {
5567 $ui_comm tag add sel 0.0 end
5568 tk_textCopy $ui_comm
@@ -5697,7 +5571,6 @@ $ctxm add command \
5571 $ctxm add separator
5572 $ctxm add command \
5573 -label {Sign Off} \
5700 - -font font_ui \
5574 -command do_signoff
5575 bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
5576
@@ -5732,18 +5605,15 @@ label .vpane.lower.diff.header.status \
5605 -background orange \
5606 -width $max_status_desc \
5607 -anchor w \
5735 - -justify left \
5736 - -font font_ui
5608 + -justify left
5609 label .vpane.lower.diff.header.file \
5610 -background orange \
5611 -anchor w \
5740 - -justify left \
5741 - -font font_ui
5612 + -justify left
5613 label .vpane.lower.diff.header.path \
5614 -background orange \
5615 -anchor w \
5745 - -justify left \
5746 - -font font_ui
5616 + -justify left
5617 pack .vpane.lower.diff.header.status -side left
5618 pack .vpane.lower.diff.header.file -side left
5619 pack .vpane.lower.diff.header.path -fill x
@@ -5751,7 +5621,6 @@ set ctxm .vpane.lower.diff.header.ctxm
5621 menu $ctxm -tearoff 0
5622 $ctxm add command \
5623 -label {Copy} \
5754 - -font font_ui \
5624 -command {
5625 clipboard clear
5626 clipboard append \
@@ -5820,22 +5689,18 @@ set ctxm .vpane.lower.diff.body.ctxm
5689 menu $ctxm -tearoff 0
5690 $ctxm add command \
5691 -label {Refresh} \
5823 - -font font_ui \
5692 -command reshow_diff
5693 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5694 $ctxm add command \
5695 -label {Copy} \
5828 - -font font_ui \
5696 -command {tk_textCopy $ui_diff}
5697 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5698 $ctxm add command \
5699 -label {Select All} \
5833 - -font font_ui \
5700 -command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
5701 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5702 $ctxm add command \
5703 -label {Copy All} \
5838 - -font font_ui \
5704 -command {
5705 $ui_diff tag add sel 0.0 end
5706 tk_textCopy $ui_diff
@@ -5845,25 +5710,21 @@ lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5710 $ctxm add separator
5711 $ctxm add command \
5712 -label {Apply/Reverse Hunk} \
5848 - -font font_ui \
5713 -command {apply_hunk $cursorX $cursorY}
5714 set ui_diff_applyhunk [$ctxm index last]
5715 lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
5716 $ctxm add separator
5717 $ctxm add command \
5718 -label {Decrease Font Size} \
5855 - -font font_ui \
5719 -command {incr_font_size font_diff -1}
5720 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5721 $ctxm add command \
5722 -label {Increase Font Size} \
5860 - -font font_ui \
5723 -command {incr_font_size font_diff 1}
5724 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5725 $ctxm add separator
5726 $ctxm add command \
5727 -label {Show Less Context} \
5866 - -font font_ui \
5728 -command {if {$repo_config(gui.diffcontext) >= 2} {
5729 incr repo_config(gui.diffcontext) -1
5730 reshow_diff
@@ -5871,7 +5732,6 @@ $ctxm add command \
5732 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5733 $ctxm add command \
5734 -label {Show More Context} \
5874 - -font font_ui \
5735 -command {
5736 incr repo_config(gui.diffcontext)
5737 reshow_diff
@@ -5879,7 +5739,6 @@ $ctxm add command \
5739 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
5740 $ctxm add separator
5741 $ctxm add command -label {Options...} \
5882 - -font font_ui \
5742 -command do_options
5743 bind_button3 $ui_diff "
5744 set cursorX %x
@@ -5899,8 +5758,7 @@ label .status -textvariable ui_status_value \
5758 -anchor w \
5759 -justify left \
5760 -borderwidth 1 \
5902 - -relief sunken \
5903 - -font font_ui
5761 + -relief sunken
5762 pack .status -anchor w -side bottom -fill x
5763
5764 # -- Load geometry