Skip to content

Commit fdc0e3a

Browse files
committed
git-gui: remove ${NS} indirection for ttk
git-gui uses ${NS} to switch between non-themed and themed widgets, with ${NS} == 'ttk' selecting the latter. As git-gui now always uses ttk, this indirection is not needed. Remove it. Signed-off-by: Mark Levedahl <[email protected]>
1 parent ed7d2af commit fdc0e3a

26 files changed

+308
-313
lines changed

git-gui.sh

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,13 +3259,13 @@ default {
32593259

32603260
# -- Branch Control
32613261
#
3262-
${NS}::frame .branch
3262+
ttk::frame .branch
32633263
if {!$use_ttk} {.branch configure -borderwidth 1 -relief sunken}
3264-
${NS}::label .branch.l1 \
3264+
ttk::label .branch.l1 \
32653265
-text [mc "Current Branch:"] \
32663266
-anchor w \
32673267
-justify left
3268-
${NS}::label .branch.cb \
3268+
ttk::label .branch.cb \
32693269
-textvariable current_branch \
32703270
-anchor w \
32713271
-justify left
@@ -3275,8 +3275,8 @@ pack .branch -side top -fill x
32753275

32763276
# -- Main Window Layout
32773277
#
3278-
${NS}::panedwindow .vpane -orient horizontal
3279-
${NS}::panedwindow .vpane.files -orient vertical
3278+
ttk::panedwindow .vpane -orient horizontal
3279+
ttk::panedwindow .vpane.files -orient vertical
32803280
if {$use_ttk} {
32813281
.vpane add .vpane.files
32823282
} else {
@@ -3298,8 +3298,8 @@ ttext $ui_workdir \
32983298
-xscrollcommand {.vpane.files.workdir.sx set} \
32993299
-yscrollcommand {.vpane.files.workdir.sy set} \
33003300
-state disabled
3301-
${NS}::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
3302-
${NS}::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
3301+
ttk::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
3302+
ttk::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
33033303
pack .vpane.files.workdir.title -side top -fill x
33043304
pack .vpane.files.workdir.sx -side bottom -fill x
33053305
pack .vpane.files.workdir.sy -side right -fill y
@@ -3320,8 +3320,8 @@ ttext $ui_index \
33203320
-xscrollcommand {.vpane.files.index.sx set} \
33213321
-yscrollcommand {.vpane.files.index.sy set} \
33223322
-state disabled
3323-
${NS}::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
3324-
${NS}::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
3323+
ttk::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
3324+
ttk::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
33253325
pack .vpane.files.index.title -side top -fill x
33263326
pack .vpane.files.index.sx -side bottom -fill x
33273327
pack .vpane.files.index.sy -side right -fill y
@@ -3355,9 +3355,9 @@ unset i
33553355

33563356
# -- Diff and Commit Area
33573357
#
3358-
${NS}::panedwindow .vpane.lower -orient vertical
3359-
${NS}::frame .vpane.lower.commarea
3360-
${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
3358+
ttk::panedwindow .vpane.lower -orient vertical
3359+
ttk::frame .vpane.lower.commarea
3360+
ttk::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
33613361
.vpane.lower add .vpane.lower.diff
33623362
.vpane.lower add .vpane.lower.commarea
33633363
.vpane add .vpane.lower
@@ -3371,60 +3371,60 @@ if {$use_ttk} {
33713371

33723372
# -- Commit Area Buttons
33733373
#
3374-
${NS}::frame .vpane.lower.commarea.buttons
3375-
${NS}::label .vpane.lower.commarea.buttons.l -text {} \
3374+
ttk::frame .vpane.lower.commarea.buttons
3375+
ttk::label .vpane.lower.commarea.buttons.l -text {} \
33763376
-anchor w \
33773377
-justify left
33783378
pack .vpane.lower.commarea.buttons.l -side top -fill x
33793379
pack .vpane.lower.commarea.buttons -side left -fill y
33803380

3381-
${NS}::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
3381+
ttk::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
33823382
-command ui_do_rescan
33833383
pack .vpane.lower.commarea.buttons.rescan -side top -fill x
33843384
lappend disable_on_lock \
33853385
{.vpane.lower.commarea.buttons.rescan conf -state}
33863386

3387-
${NS}::button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
3387+
ttk::button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
33883388
-command do_add_all
33893389
pack .vpane.lower.commarea.buttons.incall -side top -fill x
33903390
lappend disable_on_lock \
33913391
{.vpane.lower.commarea.buttons.incall conf -state}
33923392

33933393
if {![is_enabled nocommitmsg]} {
3394-
${NS}::button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
3394+
ttk::button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
33953395
-command do_signoff
33963396
pack .vpane.lower.commarea.buttons.signoff -side top -fill x
33973397
}
33983398

3399-
${NS}::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
3399+
ttk::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
34003400
-command do_commit
34013401
pack .vpane.lower.commarea.buttons.commit -side top -fill x
34023402
lappend disable_on_lock \
34033403
{.vpane.lower.commarea.buttons.commit conf -state}
34043404

34053405
if {![is_enabled nocommit]} {
3406-
${NS}::button .vpane.lower.commarea.buttons.push -text [mc Push] \
3406+
ttk::button .vpane.lower.commarea.buttons.push -text [mc Push] \
34073407
-command do_push_anywhere
34083408
pack .vpane.lower.commarea.buttons.push -side top -fill x
34093409
}
34103410

34113411
# -- Commit Message Buffer
34123412
#
3413-
${NS}::frame .vpane.lower.commarea.buffer
3414-
${NS}::frame .vpane.lower.commarea.buffer.header
3413+
ttk::frame .vpane.lower.commarea.buffer
3414+
ttk::frame .vpane.lower.commarea.buffer.header
34153415
set ui_comm .vpane.lower.commarea.buffer.frame.t
34163416
set ui_coml .vpane.lower.commarea.buffer.header.l
34173417

34183418
if {![is_enabled nocommit]} {
3419-
${NS}::checkbutton .vpane.lower.commarea.buffer.header.amend \
3419+
ttk::checkbutton .vpane.lower.commarea.buffer.header.amend \
34203420
-text [mc "Amend Last Commit"] \
34213421
-variable commit_type_is_amend \
34223422
-command do_select_commit_type
34233423
lappend disable_on_lock \
34243424
[list .vpane.lower.commarea.buffer.header.amend conf -state]
34253425
}
34263426

3427-
${NS}::label $ui_coml \
3427+
ttk::label $ui_coml \
34283428
-anchor w \
34293429
-justify left
34303430
proc trace_commit_type {varname args} {
@@ -3459,10 +3459,10 @@ ttext $ui_comm \
34593459
-font font_diff \
34603460
-xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
34613461
-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
3462-
${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
3462+
ttk::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
34633463
-orient horizontal \
34643464
-command [list $ui_comm xview]
3465-
${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
3465+
ttk::scrollbar .vpane.lower.commarea.buffer.frame.sby \
34663466
-orient vertical \
34673467
-command [list $ui_comm yview]
34683468

@@ -3585,9 +3585,9 @@ ttext $ui_diff \
35853585
-yscrollcommand {.vpane.lower.diff.body.sby set} \
35863586
-state disabled
35873587
catch {$ui_diff configure -tabstyle wordprocessor}
3588-
${NS}::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
3588+
ttk::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
35893589
-command [list $ui_diff xview]
3590-
${NS}::scrollbar .vpane.lower.diff.body.sby -orient vertical \
3590+
ttk::scrollbar .vpane.lower.diff.body.sby -orient vertical \
35913591
-command [list $ui_diff yview]
35923592
pack .vpane.lower.diff.body.sbx -side bottom -fill x
35933593
pack .vpane.lower.diff.body.sby -side right -fill y

lib/about.tcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
proc do_about {} {
55
global appvers copyright oguilib
66
global tcl_patchLevel tk_patchLevel
7-
global ui_comm_spell NS use_ttk
7+
global ui_comm_spell use_ttk
88

99
set w .about_dialog
1010
Dialog $w
1111
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
1212

1313
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
14-
${NS}::label $w.header -text [mc "About %s" [appname]] \
14+
ttk::label $w.header -text [mc "About %s" [appname]] \
1515
-font font_uibold -anchor center
1616
pack $w.header -side top -fill x
1717

18-
${NS}::frame $w.buttons
19-
${NS}::button $w.buttons.close -text {Close} \
18+
ttk::frame $w.buttons
19+
ttk::button $w.buttons.close -text {Close} \
2020
-default active \
2121
-command [list destroy $w]
2222
pack $w.buttons.close -side right

lib/blame.tcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ field tooltip_timer {} ; # Current timer event for our tooltip
6363
field tooltip_commit {} ; # Commit(s) in tooltip
6464

6565
constructor new {i_commit i_path i_jump} {
66-
global cursor_ptr M1B M1T NS
66+
global cursor_ptr M1B M1T
6767
variable active_color
6868
variable group_colors
6969

@@ -210,10 +210,10 @@ constructor new {i_commit i_path i_jump} {
210210

211211
set w_columns [list $w_amov $w_asim $w_line $w_file]
212212

213-
${NS}::scrollbar $w.file_pane.out.sbx \
213+
ttk::scrollbar $w.file_pane.out.sbx \
214214
-orient h \
215215
-command [list $w_file xview]
216-
${NS}::scrollbar $w.file_pane.out.sby \
216+
ttk::scrollbar $w.file_pane.out.sby \
217217
-orient v \
218218
-command [list scrollbar2many $w_columns yview]
219219
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
@@ -263,10 +263,10 @@ constructor new {i_commit i_path i_jump} {
263263
-background $active_color \
264264
-font font_ui
265265
$w_cviewer tag raise sel
266-
${NS}::scrollbar $w.file_pane.cm.sbx \
266+
ttk::scrollbar $w.file_pane.cm.sbx \
267267
-orient h \
268268
-command [list $w_cviewer xview]
269-
${NS}::scrollbar $w.file_pane.cm.sby \
269+
ttk::scrollbar $w.file_pane.cm.sby \
270270
-orient v \
271271
-command [list $w_cviewer yview]
272272
pack $w.file_pane.cm.sby -side right -fill y

lib/branch_checkout.tcl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ field opt_fetch 1; # refetch tracking branch if used?
1010
field opt_detach 0; # force a detached head case?
1111

1212
constructor dialog {} {
13-
global use_ttk NS
13+
global use_ttk
1414
make_dialog top w
1515
wm withdraw $w
1616
wm title $top [mc "%s (%s): Checkout Branch" [appname] [reponame]]
1717
if {$top ne {.}} {
1818
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
1919
}
2020

21-
${NS}::label $w.header -text [mc "Checkout Branch"] \
21+
ttk::label $w.header -text [mc "Checkout Branch"] \
2222
-font font_uibold -anchor center
2323
pack $w.header -side top -fill x
2424

25-
${NS}::frame $w.buttons
26-
${NS}::button $w.buttons.create -text [mc Checkout] \
25+
ttk::frame $w.buttons
26+
ttk::button $w.buttons.create -text [mc Checkout] \
2727
-default active \
2828
-command [cb _checkout]
2929
pack $w.buttons.create -side right
30-
${NS}::button $w.buttons.cancel -text [mc Cancel] \
30+
ttk::button $w.buttons.cancel -text [mc Cancel] \
3131
-command [list destroy $w]
3232
pack $w.buttons.cancel -side right -padx 5
3333
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -36,14 +36,14 @@ constructor dialog {} {
3636
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
3737
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
3838

39-
${NS}::labelframe $w.options -text [mc Options]
39+
ttk::labelframe $w.options -text [mc Options]
4040

41-
${NS}::checkbutton $w.options.fetch \
41+
ttk::checkbutton $w.options.fetch \
4242
-text [mc "Fetch Tracking Branch"] \
4343
-variable @opt_fetch
4444
pack $w.options.fetch -anchor nw
4545

46-
${NS}::checkbutton $w.options.detach \
46+
ttk::checkbutton $w.options.detach \
4747
-text [mc "Detach From Local Branch"] \
4848
-variable @opt_detach
4949
pack $w.options.detach -anchor nw

lib/branch_create.tcl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ field opt_fetch 1; # refetch tracking branch if used?
1616
field reset_ok 0; # did the user agree to reset?
1717

1818
constructor dialog {} {
19-
global repo_config use_ttk NS
19+
global repo_config use_ttk
2020

2121
make_dialog top w
2222
wm withdraw $w
@@ -25,35 +25,35 @@ constructor dialog {} {
2525
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
2626
}
2727

28-
${NS}::label $w.header -text [mc "Create New Branch"] \
28+
ttk::label $w.header -text [mc "Create New Branch"] \
2929
-font font_uibold -anchor center
3030
pack $w.header -side top -fill x
3131

32-
${NS}::frame $w.buttons
33-
${NS}::button $w.buttons.create -text [mc Create] \
32+
ttk::frame $w.buttons
33+
ttk::button $w.buttons.create -text [mc Create] \
3434
-default active \
3535
-command [cb _create]
3636
pack $w.buttons.create -side right
37-
${NS}::button $w.buttons.cancel -text [mc Cancel] \
37+
ttk::button $w.buttons.cancel -text [mc Cancel] \
3838
-command [list destroy $w]
3939
pack $w.buttons.cancel -side right -padx 5
4040
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
4141

42-
${NS}::labelframe $w.desc -text [mc "Branch Name"]
43-
${NS}::radiobutton $w.desc.name_r \
42+
ttk::labelframe $w.desc -text [mc "Branch Name"]
43+
ttk::radiobutton $w.desc.name_r \
4444
-text [mc "Name:"] \
4545
-value user \
4646
-variable @name_type
4747
if {!$use_ttk} {$w.desc.name_r configure -anchor w}
4848
set w_name $w.desc.name_t
49-
${NS}::entry $w_name \
49+
ttk::entry $w_name \
5050
-width 40 \
5151
-textvariable @name \
5252
-validate key \
5353
-validatecommand [cb _validate %d %S]
5454
grid $w.desc.name_r $w_name -sticky we -padx {0 5}
5555

56-
${NS}::radiobutton $w.desc.match_r \
56+
ttk::radiobutton $w.desc.match_r \
5757
-text [mc "Match Tracking Branch Name"] \
5858
-value match \
5959
-variable @name_type
@@ -66,34 +66,34 @@ constructor dialog {} {
6666
set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
6767
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
6868

69-
${NS}::labelframe $w.options -text [mc Options]
69+
ttk::labelframe $w.options -text [mc Options]
7070

71-
${NS}::frame $w.options.merge
72-
${NS}::label $w.options.merge.l -text [mc "Update Existing Branch:"]
71+
ttk::frame $w.options.merge
72+
ttk::label $w.options.merge.l -text [mc "Update Existing Branch:"]
7373
pack $w.options.merge.l -side left
74-
${NS}::radiobutton $w.options.merge.no \
74+
ttk::radiobutton $w.options.merge.no \
7575
-text [mc No] \
7676
-value none \
7777
-variable @opt_merge
7878
pack $w.options.merge.no -side left
79-
${NS}::radiobutton $w.options.merge.ff \
79+
ttk::radiobutton $w.options.merge.ff \
8080
-text [mc "Fast Forward Only"] \
8181
-value ff \
8282
-variable @opt_merge
8383
pack $w.options.merge.ff -side left
84-
${NS}::radiobutton $w.options.merge.reset \
84+
ttk::radiobutton $w.options.merge.reset \
8585
-text [mc Reset] \
8686
-value reset \
8787
-variable @opt_merge
8888
pack $w.options.merge.reset -side left
8989
pack $w.options.merge -anchor nw
9090

91-
${NS}::checkbutton $w.options.fetch \
91+
ttk::checkbutton $w.options.fetch \
9292
-text [mc "Fetch Tracking Branch"] \
9393
-variable @opt_fetch
9494
pack $w.options.fetch -anchor nw
9595

96-
${NS}::checkbutton $w.options.checkout \
96+
ttk::checkbutton $w.options.checkout \
9797
-text [mc "Checkout After Creation"] \
9898
-variable @opt_checkout
9999
pack $w.options.checkout -anchor nw

0 commit comments

Comments
 (0)