git-gui: remove non-ttk code
git-gui has code paths to support older non-ttk widgets, but this code is no longer reachable as ttk is always used. Remove that code. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Mark Levedahl committed
May 20, 2025 at 13:53 UTC
9b1c537fdbdf5bcad2f73bbad8eb06983889ff78
26 files changed
+70
-219
git-gui.sh
+11
-48
@@ -912,9 +912,6 @@ proc apply_config {} {
912
font configure ${font}italic -slant italic
913
}
914
915
- global use_ttk NS
916
- set use_ttk 1
917
- set NS ttk
915
bind [winfo class .] <<ThemeChanged>> [list InitTheme]
916
pave_toplevel .
917
color::sync_with_theme
@@ -2313,7 +2310,7 @@ proc do_quit {{rc {1}}} {
2310
global ui_comm is_quitting repo_config commit_type
2311
global GITGUI_BCK_exists GITGUI_BCK_i
2312
global ui_comm_spell
2316
- global ret_code use_ttk
2313
+ global ret_code
2314
2315
if {$is_quitting} return
2316
set is_quitting 1
@@ -2371,13 +2368,8 @@ proc do_quit {{rc {1}}} {
2368
}
2369
set cfg_geometry [list]
2370
lappend cfg_geometry [wm geometry .]
2374
- if {$use_ttk} {
2375
- lappend cfg_geometry [.vpane sashpos 0]
2376
- lappend cfg_geometry [.vpane.files sashpos 0]
2377
- } else {
2378
- lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
2379
- lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
2380
- }
2371
+ lappend cfg_geometry [.vpane sashpos 0]
2372
+ lappend cfg_geometry [.vpane.files sashpos 0]
2373
if {[catch {set rc_geometry $repo_config(gui.geometry)}]} {
2374
set rc_geometry {}
2375
}
@@ -3260,7 +3252,6 @@ default {
3252
# -- Branch Control
3253
#
3254
ttk::frame .branch
3263
-if {!$use_ttk} {.branch configure -borderwidth 1 -relief sunken}
3255
ttk::label .branch.l1 \
3256
-text [mc "Current Branch:"] \
3257
-anchor w \
@@ -3277,11 +3268,7 @@ pack .branch -side top -fill x
3268
#
3269
ttk::panedwindow .vpane -orient horizontal
3270
ttk::panedwindow .vpane.files -orient vertical
3280
-if {$use_ttk} {
3281
- .vpane add .vpane.files
3282
-} else {
3283
- .vpane add .vpane.files -sticky nsew -height 100 -width 200
3284
-}
3271
+.vpane add .vpane.files
3272
pack .vpane -anchor n -side top -fill both -expand 1
3273
3274
# -- Working Directory File List
@@ -3331,10 +3318,6 @@ pack $ui_index -side left -fill both -expand 1
3318
#
3319
.vpane.files add .vpane.files.workdir
3320
.vpane.files add .vpane.files.index
3334
-if {!$use_ttk} {
3335
- .vpane.files paneconfigure .vpane.files.workdir -sticky news
3336
- .vpane.files paneconfigure .vpane.files.index -sticky news
3337
-}
3321
3322
proc set_selection_colors {w has_focus} {
3323
foreach tag [list in_diff in_sel] {
@@ -3361,13 +3344,8 @@ ttk::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
3344
.vpane.lower add .vpane.lower.diff
3345
.vpane.lower add .vpane.lower.commarea
3346
.vpane add .vpane.lower
3364
-if {$use_ttk} {
3365
- .vpane.lower pane .vpane.lower.diff -weight 1
3366
- .vpane.lower pane .vpane.lower.commarea -weight 0
3367
-} else {
3368
- .vpane.lower paneconfigure .vpane.lower.diff -stretch always
3369
- .vpane.lower paneconfigure .vpane.lower.commarea -stretch never
3370
-}
3347
+.vpane.lower pane .vpane.lower.diff -weight 1
3348
+.vpane.lower pane .vpane.lower.commarea -weight 0
3349
3350
# -- Commit Area Buttons
3351
#
@@ -3888,29 +3866,14 @@ proc on_ttk_pane_mapped {w pane pos} {
3866
bind $w <Map> {}
3867
after 0 [list after idle [list $w sashpos $pane $pos]]
3868
}
3891
-proc on_tk_pane_mapped {w pane x y} {
3892
- bind $w <Map> {}
3893
- after 0 [list after idle [list $w sash place $pane $x $y]]
3894
-}
3869
proc on_application_mapped {} {
3896
- global repo_config use_ttk
3870
+ global repo_config
3871
bind . <Map> {}
3872
set gm $repo_config(gui.geometry)
3899
- if {$use_ttk} {
3900
- bind .vpane <Map> \
3901
- [list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
3902
- bind .vpane.files <Map> \
3903
- [list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
3904
- } else {
3905
- bind .vpane <Map> \
3906
- [list on_tk_pane_mapped %W 0 \
3907
- [lindex $gm 1] \
3908
- [lindex [.vpane sash coord 0] 1]]
3909
- bind .vpane.files <Map> \
3910
- [list on_tk_pane_mapped %W 0 \
3911
- [lindex [.vpane.files sash coord 0] 0] \
3912
- [lindex $gm 2]]
3913
- }
3873
+ bind .vpane <Map> \
3874
+ [list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
3875
+ bind .vpane.files <Map> \
3876
+ [list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
3877
wm geometry . [lindex $gm 0]
3878
}
3879
if {[info exists repo_config(gui.geometry)]} {
lib/about.tcl
+1
-1
@@ -4,7 +4,7 @@
4
proc do_about {} {
5
global appvers copyright oguilib
6
global tcl_patchLevel tk_patchLevel
7
- global ui_comm_spell use_ttk
7
+ global ui_comm_spell
8
9
set w .about_dialog
10
Dialog $w
lib/branch_checkout.tcl
-1
@@ -10,7 +10,6 @@ field opt_fetch 1; # refetch tracking branch if used?
10
field opt_detach 0; # force a detached head case?
11
12
constructor dialog {} {
13
- global use_ttk
13
make_dialog top w
14
wm withdraw $w
15
wm title $top [mc "%s (%s): Checkout Branch" [appname] [reponame]]
lib/branch_create.tcl
+1
-3
@@ -16,7 +16,7 @@ field opt_fetch 1; # refetch tracking branch if used?
16
field reset_ok 0; # did the user agree to reset?
17
18
constructor dialog {} {
19
- global repo_config use_ttk
19
+ global repo_config
20
21
make_dialog top w
22
wm withdraw $w
@@ -44,7 +44,6 @@ constructor dialog {} {
44
-text [mc "Name:"] \
45
-value user \
46
-variable @name_type
47
- if {!$use_ttk} {$w.desc.name_r configure -anchor w}
47
set w_name $w.desc.name_t
48
ttk::entry $w_name \
49
-width 40 \
@@ -57,7 +56,6 @@ constructor dialog {} {
56
-text [mc "Match Tracking Branch Name"] \
57
-value match \
58
-variable @name_type
60
- if {!$use_ttk} {$w.desc.match_r configure -anchor w}
59
grid $w.desc.match_r -sticky we -padx {0 5} -columnspan 2
60
61
grid columnconfigure $w.desc 1 -weight 1
lib/branch_delete.tcl
+1
-1
@@ -9,7 +9,7 @@ field w_check ; # revision picker for merge test
9
field w_delete ; # delete button
10
11
constructor dialog {} {
12
- global current_branch use_ttk
12
+ global current_branch
13
14
make_dialog top w
15
wm withdraw $w
lib/branch_rename.tcl
+3
-7
@@ -8,7 +8,7 @@ field oldname
8
field newname
9
10
constructor dialog {} {
11
- global current_branch use_ttk
11
+ global current_branch
12
13
make_dialog top w
14
wm withdraw $w
@@ -36,12 +36,8 @@ constructor dialog {} {
36
37
ttk::frame $w.rename
38
ttk::label $w.rename.oldname_l -text [mc "Branch:"]
39
- if {$use_ttk} {
40
- ttk::combobox $w.rename.oldname_m -textvariable @oldname \
41
- -values [load_all_heads] -state readonly
42
- } else {
43
- eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
44
- }
39
+ ttk::combobox $w.rename.oldname_m -textvariable @oldname \
40
+ -values [load_all_heads] -state readonly
41
42
ttk::label $w.rename.newname_l -text [mc "New Name:"]
43
ttk::entry $w.rename.newname_t \
lib/browser.tcl
+1
-4
@@ -21,7 +21,7 @@ field browser_busy 1
21
field ls_buf {}; # Buffered record output from ls-tree
22
23
constructor new {commit {path {}}} {
24
- global cursor_ptr M1B use_ttk
24
+ global cursor_ptr M1B
25
make_dialog top w
26
wm withdraw $top
27
wm title $top [mc "%s (%s): File Browser" [appname] [reponame]]
@@ -40,7 +40,6 @@ constructor new {commit {path {}}} {
40
-anchor w \
41
-justify left \
42
-font font_uibold
43
- if {!$use_ttk} { $w.path configure -borderwidth 1 -relief sunken}
43
pack $w.path -anchor w -side top -fill x
44
45
ttk::frame $w.list
@@ -66,7 +65,6 @@ constructor new {commit {path {}}} {
65
-textvariable @browser_status \
66
-anchor w \
67
-justify left
69
- if {!$use_ttk} { $w.status configure -borderwidth 1 -relief sunken}
68
pack $w.status -anchor w -side bottom -fill x
69
70
bind $w_list <Button-1> "[cb _click 0 @%x,%y];break"
@@ -269,7 +267,6 @@ field w ; # widget path
267
field w_rev ; # mega-widget to pick the initial revision
268
269
constructor dialog {} {
272
- global use_ttk
270
make_dialog top w
271
wm withdraw $top
272
wm title $top [mc "%s (%s): Browse Branch Files" [appname] [reponame]]
lib/choose_font.tcl
-1
@@ -17,7 +17,6 @@ variable all_families [list] ; # All fonts known to Tk
17
18
constructor pick {path title a_family a_size} {
19
variable all_families
20
- global use_ttk
20
21
set v_family $a_family
22
set v_size $a_size
lib/choose_repository.tcl
+1
-3
@@ -35,7 +35,7 @@ field readtree_err ; # Error output from read-tree (if any)
35
field sorted_recent ; # recent repositories (sorted)
36
37
constructor pick {} {
38
- global M1T M1B use_ttk
38
+ global M1T M1B
39
40
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
41
set maxrecent 10
@@ -378,7 +378,6 @@ proc _objdir {path} {
378
## Create New Repository
379
380
method _do_new {} {
381
- global use_ttk
381
$w_next conf \
382
-state disabled \
383
-command [cb _do_new2] \
@@ -462,7 +461,6 @@ proc _new_ok {p} {
461
## Clone Existing Repository
462
463
method _do_clone {} {
465
- global use_ttk
464
$w_next conf \
465
-state disabled \
466
-command [cb _do_clone2] \
lib/choose_rev.tcl
+3
-12
@@ -32,7 +32,7 @@ proc new_unmerged {path {title {}}} {
32
}
33
34
constructor _new {path unmerged_only title} {
35
- global current_branch is_detached use_ttk
35
+ global current_branch is_detached
36
37
if {![info exists ::all_remotes]} {
38
load_all_remotes
@@ -52,7 +52,6 @@ constructor _new {path unmerged_only title} {
52
-text [mc "This Detached Checkout"] \
53
-value HEAD \
54
-variable @revtype
55
- if {!$use_ttk} {$w.detachedhead_r configure -anchor w}
55
grid $w.detachedhead_r -sticky we -padx {0 5} -columnspan 2
56
}
57
@@ -95,11 +94,7 @@ constructor _new {path unmerged_only title} {
94
] -side right
95
grid $w.types -sticky we -padx {0 5} -columnspan 2
96
98
- if {$use_ttk} {
99
- ttk::frame $w.list -style SListbox.TFrame -padding 2
100
- } else {
101
- frame $w.list
102
- }
97
+ ttk::frame $w.list -style SListbox.TFrame -padding 2
98
set w_list $w.list.l
99
listbox $w_list \
100
-font font_diff \
@@ -109,9 +104,7 @@ constructor _new {path unmerged_only title} {
104
-exportselection false \
105
-xscrollcommand [cb _sb_set $w.list.sbx h] \
106
-yscrollcommand [cb _sb_set $w.list.sby v]
112
- if {$use_ttk} {
113
- $w_list configure -relief flat -highlightthickness 0 -borderwidth 0
114
- }
107
+ $w_list configure -relief flat -highlightthickness 0 -borderwidth 0
108
pack $w_list -fill both -expand 1
109
grid $w.list -sticky nswe -padx {20 5} -columnspan 2
110
bind $w_list <Any-Motion> [cb _show_tooltip @%x,%y]
@@ -238,12 +231,10 @@ constructor _new {path unmerged_only title} {
231
}
232
233
method none {text} {
241
- global use_ttk
234
if {![winfo exists $w.none_r]} {
235
ttk::radiobutton $w.none_r \
236
-value none \
237
-variable @revtype
246
- if {!$use_ttk} {$w.none_r configure -anchor w}
238
grid $w.none_r -sticky we -padx {0 5} -columnspan 2
239
}
240
$w.none_r configure -text $text
lib/class.tcl
-1
@@ -136,7 +136,6 @@ proc delete_this {{t {}}} {
136
137
proc make_dialog {t w args} {
138
upvar $t top $w pfx this this
139
- global use_ttk
139
uplevel [linsert $args 0 make_toplevel $t $w]
140
catch {wm attributes $top -type dialog}
141
pave_toplevel $pfx
lib/console.tcl
+1
-1
@@ -27,7 +27,7 @@ constructor embed {path title} {
27
}
28
29
method _init {} {
30
- global M1B use_ttk
30
+ global M1B
31
32
if {$is_toplevel} {
33
make_dialog top w -autodelete 0
lib/database.tcl
-1
@@ -2,7 +2,6 @@
2
# Copyright (C) 2006, 2007 Shawn Pearce
3
4
proc do_stats {} {
5
- global use_ttk
5
set fd [git_read [list count-objects -v]]
6
while {[gets $fd line] > 0} {
7
if {[regexp {^([^:]+): (\d+)$} $line _ name value]} {
lib/error.tcl
-1
@@ -71,7 +71,6 @@ proc ask_popup {msg} {
71
}
72
73
proc hook_failed_popup {hook msg {is_fatal 1}} {
74
- global use_ttk
74
set w .hookfail
75
Dialog $w
76
wm withdraw $w
lib/index.tcl
-2
@@ -22,8 +22,6 @@ proc _close_updateindex {fd} {
22
}
23
24
proc rescan_on_error {err {after {}}} {
25
- global use_ttk
26
-
25
set w .indexfried
26
Dialog $w
27
wm withdraw $w
lib/line.tcl
-1
@@ -9,7 +9,6 @@ field ctext
9
field linenum {}
10
11
constructor new {i_w i_text args} {
12
- global use_ttk
12
set w $i_w
13
set ctext $i_text
14
lib/merge.tcl
+1
-1
@@ -145,7 +145,7 @@ method _finish {cons ok} {
145
146
constructor dialog {} {
147
global current_branch
148
- global M1B use_ttk
148
+ global M1B
149
150
if {![_can_merge $this]} {
151
delete_this
lib/option.tcl
+7
-19
@@ -91,7 +91,7 @@ proc save_config {} {
91
proc do_options {} {
92
global repo_config global_config font_descs
93
global repo_config_new global_config_new
94
- global ui_comm_spell use_ttk
94
+ global ui_comm_spell
95
96
array unset repo_config_new
97
array unset global_config_new
@@ -218,15 +218,9 @@ proc do_options {} {
218
set opts [eval [lindex $option 3]]
219
ttk::frame $w.$f.$optid
220
ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
221
- if {$use_ttk} {
222
- ttk::combobox $w.$f.$optid.v \
223
- -textvariable ${f}_config_new($name) \
224
- -values $opts -state readonly
225
- } else {
226
- eval tk_optionMenu $w.$f.$optid.v \
227
- ${f}_config_new($name) \
228
- $opts
229
- }
221
+ ttk::combobox $w.$f.$optid.v \
222
+ -textvariable ${f}_config_new($name) \
223
+ -values $opts -state readonly
224
pack $w.$f.$optid.l -side left -anchor w -fill x
225
pack $w.$f.$optid.v -side right -anchor e -padx 5
226
pack $w.$f.$optid -side top -anchor w -fill x
@@ -252,15 +246,9 @@ proc do_options {} {
246
247
ttk::frame $w.$f.$optid
248
ttk::label $w.$f.$optid.l -text [mc "Spelling Dictionary:"]
255
- if {$use_ttk} {
256
- ttk::combobox $w.$f.$optid.v \
257
- -textvariable ${f}_config_new(gui.spellingdictionary) \
258
- -values $all_dicts -state readonly
259
- } else {
260
- eval tk_optionMenu $w.$f.$optid.v \
261
- ${f}_config_new(gui.spellingdictionary) \
262
- $all_dicts
263
- }
249
+ ttk::combobox $w.$f.$optid.v \
250
+ -textvariable ${f}_config_new(gui.spellingdictionary) \
251
+ -values $all_dicts -state readonly
252
pack $w.$f.$optid.l -side left -anchor w -fill x
253
pack $w.$f.$optid.v -side right -anchor e -padx 5
254
pack $w.$f.$optid -side top -anchor w -fill x
lib/remote_add.tcl
+1
-1
@@ -13,7 +13,7 @@ field location {}; # location of the remote the user has chosen
13
field opt_action fetch; # action to do after registering the remote locally
14
15
constructor dialog {} {
16
- global repo_config use_ttk
16
+ global repo_config
17
18
make_dialog top w
19
wm withdraw $top
lib/remote_branch_delete.tcl
+3
-7
@@ -23,7 +23,7 @@ field full_cache
23
field cached
24
25
constructor dialog {} {
26
- global all_remotes M1B use_ttk
26
+ global all_remotes M1B
27
28
make_dialog top w
29
wm title $top [mc "%s (%s): Delete Branch Remotely" [appname] [reponame]]
@@ -51,12 +51,8 @@ constructor dialog {} {
51
-text [mc "Remote:"] \
52
-value remote \
53
-variable @urltype
54
- if {$use_ttk} {
55
- ttk::combobox $w.dest.remote_m -textvariable @remote \
56
- -values $all_remotes -state readonly
57
- } else {
58
- eval tk_optionMenu $w.dest.remote_m @remote $all_remotes
59
- }
54
+ ttk::combobox $w.dest.remote_m -textvariable @remote \
55
+ -values $all_remotes -state readonly
56
grid $w.dest.remote_r $w.dest.remote_m -sticky w
57
if {[lsearch -sorted -exact $all_remotes origin] != -1} {
58
set remote origin
lib/search.tcl
-1
@@ -21,7 +21,6 @@ field smarktop
21
field smarkbot
22
23
constructor new {i_w i_text args} {
24
- global use_ttk
24
set w $i_w
25
set ctext $i_text
26
lib/sshkey.tcl
+2
-3
@@ -18,7 +18,7 @@ proc find_ssh_key {} {
18
}
19
20
proc do_ssh_key {} {
21
- global sshkey_title sshkey_fd use_ttk
21
+ global sshkey_title sshkey_fd
22
23
set w .sshkey_dialog
24
if {[winfo exists $w]} {
@@ -48,8 +48,7 @@ proc do_ssh_key {} {
48
49
text $w.contents -width 60 -height 10 -wrap char -relief sunken
50
pack $w.contents -fill both -expand 1
51
- set clr darkblue
52
- if {$use_ttk} { set clr [ttk::style lookup . -selectbackground] }
51
+ set clr [ttk::style lookup . -selectbackground]
52
$w.contents configure -inactiveselectbackground $clr
53
54
ttk::frame $w.buttons
lib/status_bar.tcl
-4
@@ -39,7 +39,6 @@ field operations ; # list of current ongoing operations
39
field completed_operation_count
40
41
constructor new {path} {
42
- global use_ttk
42
set w $path
43
set w_l $w.l
44
set w_c $w.c
@@ -52,9 +51,6 @@ constructor new {path} {
51
set completed_operation_count 0
52
53
ttk::frame $w
55
- if {!$use_ttk} {
56
- $w configure -borderwidth 1 -relief sunken
57
- }
54
ttk::label $w_l \
55
-textvariable @status_bar_text \
56
-anchor w \
lib/themed.tcl
+25
-83
@@ -190,8 +190,7 @@ proc InitEntryFrame {} {
190
}
191
192
proc gold_frame {w args} {
193
- global use_ttk
194
- if {$use_ttk && ![is_MacOSX]} {
193
+ if {![is_MacOSX]} {
194
eval [linsert $args 0 ttk::frame $w -style Gold.TFrame]
195
} else {
196
eval [linsert $args 0 frame $w -background gold]
@@ -199,8 +198,7 @@ proc gold_frame {w args} {
198
}
199
200
proc tlabel {w args} {
202
- global use_ttk
203
- if {$use_ttk && ![is_MacOSX]} {
201
+ if {![is_MacOSX]} {
202
set cmd [list ttk::label $w -style Color.TLabel]
203
foreach {k v} $args {
204
switch -glob -- $k {
@@ -216,17 +214,7 @@ proc tlabel {w args} {
214
215
# The padded label gets used in the about class.
216
proc paddedlabel {w args} {
219
- global use_ttk
220
- if {$use_ttk} {
221
- eval [linsert $args 0 ttk::label $w -style Padded.TLabel]
222
- } else {
223
- eval [linsert $args 0 label $w \
224
- -padx 5 -pady 5 \
225
- -justify left \
226
- -anchor w \
227
- -borderwidth 1 \
228
- -relief solid]
229
- }
217
+ eval [linsert $args 0 ttk::label $w -style Padded.TLabel]
218
}
219
220
# Create a toplevel for use as a dialog.
@@ -242,8 +230,7 @@ proc Dialog {w args} {
230
# Tk toplevels are not themed - so pave it over with a themed frame to get
231
# the base color correct per theme.
232
proc pave_toplevel {w} {
245
- global use_ttk
246
- if {$use_ttk && ![winfo exists $w.!paving]} {
233
+ if {![winfo exists $w.!paving]} {
234
set paving [ttk::frame $w.!paving]
235
place $paving -x 0 -y 0 -relwidth 1 -relheight 1
236
lower $paving
@@ -254,19 +241,10 @@ proc pave_toplevel {w} {
241
# On many themes the border for a scrolled listbox needs to go around the
242
# listbox and the scrollbar.
243
proc slistbox {w args} {
257
- global use_ttk
258
- if {$use_ttk} {
259
- set f [ttk::frame $w -style SListbox.TFrame -padding 2]
260
- } else {
261
- set f [frame $w -relief flat]
262
- }
244
+ set f [ttk::frame $w -style SListbox.TFrame -padding 2]
245
if {[catch {
264
- if {$use_ttk} {
265
- eval [linsert $args 0 listbox $f.list -relief flat \
266
- -highlightthickness 0 -borderwidth 0]
267
- } else {
268
- eval [linsert $args 0 listbox $f.list]
269
- }
246
+ eval [linsert $args 0 listbox $f.list -relief flat \
247
+ -highlightthickness 0 -borderwidth 0]
248
ttk::scrollbar $f.vs -command [list $f.list yview]
249
$f.list configure -yscrollcommand [list $f.vs set]
250
grid $f.list $f.vs -sticky news
@@ -285,67 +263,42 @@ proc slistbox {w args} {
263
264
# fetch the background color from a widget.
265
proc get_bg_color {w} {
288
- global use_ttk
289
- if {$use_ttk} {
290
- set bg [ttk::style lookup [winfo class $w] -background]
291
- } else {
292
- set bg [$w cget -background]
293
- }
266
+ set bg [ttk::style lookup [winfo class $w] -background]
267
return $bg
268
}
269
297
-# ttk::spinbox didn't get added until 8.6
270
+# ttk::spinbox
271
proc tspinbox {w args} {
299
- global use_ttk
300
- if {$use_ttk && [llength [info commands ttk::spinbox]] > 0} {
301
- eval [linsert $args 0 ttk::spinbox $w]
302
- } else {
303
- eval [linsert $args 0 spinbox $w]
304
- }
272
+ eval [linsert $args 0 ttk::spinbox $w]
273
}
274
275
# Create a text widget with any theme specific properties.
276
proc ttext {w args} {
309
- global use_ttk
310
- if {$use_ttk} {
311
- switch -- [ttk_get_current_theme] {
312
- "vista" - "xpnative" {
313
- lappend args -highlightthickness 0 -borderwidth 0
314
- }
277
+ switch -- [ttk_get_current_theme] {
278
+ "vista" - "xpnative" {
279
+ lappend args -highlightthickness 0 -borderwidth 0
280
}
281
}
282
set w [eval [linsert $args 0 text $w]]
318
- if {$use_ttk} {
319
- if {[winfo class [winfo parent $w]] eq "EntryFrame"} {
320
- bind $w <FocusIn> {[winfo parent %W] state focus}
321
- bind $w <FocusOut> {[winfo parent %W] state !focus}
322
- }
283
+ if {[winfo class [winfo parent $w]] eq "EntryFrame"} {
284
+ bind $w <FocusIn> {[winfo parent %W] state focus}
285
+ bind $w <FocusOut> {[winfo parent %W] state !focus}
286
}
287
return $w
288
}
289
290
# themed frame suitable for surrounding a text field.
291
proc textframe {w args} {
329
- global use_ttk
330
- if {$use_ttk} {
331
- if {[catch {ttk::style layout EntryFrame}]} {
332
- InitEntryFrame
333
- }
334
- eval [linsert $args 0 ttk::frame $w -class EntryFrame -style EntryFrame]
335
- } else {
336
- eval [linsert $args 0 frame $w]
292
+ if {[catch {ttk::style layout EntryFrame}]} {
293
+ InitEntryFrame
294
}
295
+ eval [linsert $args 0 ttk::frame $w -class EntryFrame -style EntryFrame]
296
return $w
297
}
298
299
proc tentry {w args} {
342
- global use_ttk
343
- if {$use_ttk} {
344
- InitTheme
345
- ttk::entry $w -style Edged.Entry
346
- } else {
347
- entry $w
348
- }
300
+ InitTheme
301
+ ttk::entry $w -style Edged.Entry
302
303
rename $w _$w
304
interp alias {} $w {} tentry_widgetproc $w
@@ -353,25 +306,14 @@ proc tentry {w args} {
306
return $w
307
}
308
proc tentry_widgetproc {w cmd args} {
356
- global use_ttk
309
switch -- $cmd {
310
state {
359
- if {$use_ttk} {
360
- return [uplevel 1 [list _$w $cmd] $args]
361
- } else {
362
- if {[lsearch -exact $args pressed] != -1} {
363
- _$w configure -background lightpink
364
- } else {
365
- _$w configure -background lightgreen
366
- }
367
- }
311
+ return [uplevel 1 [list _$w $cmd] $args]
312
}
313
configure {
370
- if {$use_ttk} {
371
- if {[set n [lsearch -exact $args -background]] != -1} {
372
- set args [lreplace $args $n [incr n]]
373
- if {[llength $args] == 0} {return}
374
- }
314
+ if {[set n [lsearch -exact $args -background]] != -1} {
315
+ set args [lreplace $args $n [incr n]]
316
+ if {[llength $args] == 0} {return}
317
}
318
return [uplevel 1 [list _$w $cmd] $args]
319
}
lib/tools_dlg.tcl
+3
-3
@@ -16,7 +16,7 @@ field ask_branch 0; # ask for a revision
16
field ask_args 0; # ask for additional args
17
18
constructor dialog {} {
19
- global repo_config use_ttk
19
+ global repo_config
20
21
make_dialog top w
22
wm title $top [mc "%s (%s): Add Tool" [appname] [reponame]]
@@ -179,7 +179,7 @@ field w ; # widget path
179
field w_names ; # name list
180
181
constructor dialog {} {
182
- global repo_config global_config system_config use_ttk
182
+ global repo_config global_config system_config
183
184
load_config 1
185
@@ -272,7 +272,7 @@ field is_ok 0; # ok to start
272
field argstr {}; # arguments
273
274
constructor dialog {fullname} {
275
- global M1B use_ttk
275
+ global M1B
276
277
set title [get_config "guitool.$fullname.title"]
278
if {$title eq {}} {
lib/transport.tcl
+5
-9
@@ -120,7 +120,7 @@ trace add variable push_remote write \
120
proc do_push_anywhere {} {
121
global all_remotes current_branch
122
global push_urltype push_remote push_url push_thin push_tags
123
- global push_force use_ttk
123
+ global push_force
124
125
set w .push_setup
126
toplevel $w
@@ -165,14 +165,10 @@ proc do_push_anywhere {} {
165
-text [mc "Remote:"] \
166
-value remote \
167
-variable push_urltype
168
- if {$use_ttk} {
169
- ttk::combobox $w.dest.remote_m -state readonly \
170
- -exportselection false \
171
- -textvariable push_remote \
172
- -values $all_remotes
173
- } else {
174
- eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes
175
- }
168
+ ttk::combobox $w.dest.remote_m -state readonly \
169
+ -exportselection false \
170
+ -textvariable push_remote \
171
+ -values $all_remotes
172
grid $w.dest.remote_r $w.dest.remote_m -sticky w
173
if {[lsearch -sorted -exact $all_remotes origin] != -1} {
174
set push_remote origin