@@ -30,9 +30,7 @@ along with this program; if not, see <https://www.gnu.org/licenses/>.}]
3030# #
3131# # Tcl/Tk sanity check
3232
33- if {[catch {package require Tcl 8.5} err]
34- || [catch {package require Tk 8.5} err]
35- } {
33+ if {[catch {package require Tcl 8.6-8.8} err]} {
3634 catch {wm withdraw .}
3735 tk_messageBox \
3836 -icon error \
@@ -914,18 +912,9 @@ proc apply_config {} {
914912 font configure ${font} italic -slant italic
915913 }
916914
917- global use_ttk NS
918- set use_ttk 0
919- set NS {}
920- if {$repo_config(gui.usettk) } {
921- set use_ttk [package vsatisfies [package provide Tk] 8.5]
922- if {$use_ttk } {
923- set NS ttk
924- bind [winfo class .] <<ThemeChanged>> [list InitTheme]
925- pave_toplevel .
926- color::sync_with_theme
927- }
928- }
915+ bind [winfo class .] <<ThemeChanged>> [list InitTheme]
916+ pave_toplevel .
917+ color::sync_with_theme
929918
930919 global comment_string
931920 set comment_string [get_config core.commentstring]
@@ -1270,8 +1259,6 @@ citool {
12701259# #
12711260# # execution environment
12721261
1273- set have_tk85 [expr {[package vcompare $tk_version " 8.5" ] >= 0}]
1274-
12751262# Suggest our implementation of askpass, if none is set
12761263if {![info exists env(SSH_ASKPASS)]} {
12771264 set env(SSH_ASKPASS) [gitexec git-gui--askpass]
@@ -2333,7 +2320,7 @@ proc do_quit {{rc {1}}} {
23332320 global ui_comm is_quitting repo_config commit_type
23342321 global GITGUI_BCK_exists GITGUI_BCK_i
23352322 global ui_comm_spell
2336- global ret_code use_ttk
2323+ global ret_code
23372324
23382325 if {$is_quitting } return
23392326 set is_quitting 1
@@ -2391,13 +2378,8 @@ proc do_quit {{rc {1}}} {
23912378 }
23922379 set cfg_geometry [list ]
23932380 lappend cfg_geometry [wm geometry .]
2394- if {$use_ttk } {
2395- lappend cfg_geometry [.vpane sashpos 0]
2396- lappend cfg_geometry [.vpane.files sashpos 0]
2397- } else {
2398- lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
2399- lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
2400- }
2381+ lappend cfg_geometry [.vpane sashpos 0]
2382+ lappend cfg_geometry [.vpane.files sashpos 0]
24012383 if {[catch {set rc_geometry $repo_config(gui.geometry) }]} {
24022384 set rc_geometry {}
24032385 }
@@ -3279,13 +3261,12 @@ default {
32793261
32803262# -- Branch Control
32813263#
3282- ${NS} ::frame .branch
3283- if {!$use_ttk } {.branch configure -borderwidth 1 -relief sunken}
3284- ${NS} ::label .branch.l1 \
3264+ ttk::frame .branch
3265+ ttk::label .branch.l1 \
32853266 -text [mc " Current Branch:" ] \
32863267 -anchor w \
32873268 -justify left
3288- ${NS} ::label .branch.cb \
3269+ ttk ::label .branch.cb \
32893270 -textvariable current_branch \
32903271 -anchor w \
32913272 -justify left
@@ -3295,13 +3276,9 @@ pack .branch -side top -fill x
32953276
32963277# -- Main Window Layout
32973278#
3298- ${NS} ::panedwindow .vpane -orient horizontal
3299- ${NS} ::panedwindow .vpane.files -orient vertical
3300- if {$use_ttk } {
3301- .vpane add .vpane.files
3302- } else {
3303- .vpane add .vpane.files -sticky nsew -height 100 -width 200
3304- }
3279+ ttk::panedwindow .vpane -orient horizontal
3280+ ttk::panedwindow .vpane.files -orient vertical
3281+ .vpane add .vpane.files
33053282pack .vpane -anchor n -side top -fill both -expand 1
33063283
33073284# -- Working Directory File List
@@ -3318,8 +3295,8 @@ ttext $ui_workdir \
33183295 -xscrollcommand {.vpane.files.workdir.sx set} \
33193296 -yscrollcommand {.vpane.files.workdir.sy set} \
33203297 -state disabled
3321- ${NS} ::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
3322- ${NS} ::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
3298+ ttk ::scrollbar .vpane.files.workdir.sx -orient h -command [list $ui_workdir xview]
3299+ ttk ::scrollbar .vpane.files.workdir.sy -orient v -command [list $ui_workdir yview]
33233300pack .vpane.files.workdir.title -side top -fill x
33243301pack .vpane.files.workdir.sx -side bottom -fill x
33253302pack .vpane.files.workdir.sy -side right -fill y
@@ -3340,8 +3317,8 @@ ttext $ui_index \
33403317 -xscrollcommand {.vpane.files.index.sx set} \
33413318 -yscrollcommand {.vpane.files.index.sy set} \
33423319 -state disabled
3343- ${NS} ::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
3344- ${NS} ::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
3320+ ttk ::scrollbar .vpane.files.index.sx -orient h -command [list $ui_index xview]
3321+ ttk ::scrollbar .vpane.files.index.sy -orient v -command [list $ui_index yview]
33453322pack .vpane.files.index.title -side top -fill x
33463323pack .vpane.files.index.sx -side bottom -fill x
33473324pack .vpane.files.index.sy -side right -fill y
@@ -3351,10 +3328,6 @@ pack $ui_index -side left -fill both -expand 1
33513328#
33523329.vpane.files add .vpane.files.workdir
33533330.vpane.files add .vpane.files.index
3354- if {!$use_ttk } {
3355- .vpane.files paneconfigure .vpane.files.workdir -sticky news
3356- .vpane.files paneconfigure .vpane.files.index -sticky news
3357- }
33583331
33593332proc set_selection_colors {w has_focus} {
33603333 foreach tag [list in_diff in_sel] {
@@ -3375,86 +3348,71 @@ unset i
33753348
33763349# -- Diff and Commit Area
33773350#
3378- if {$have_tk85 } {
3379- ${NS} ::panedwindow .vpane.lower -orient vertical
3380- ${NS} ::frame .vpane.lower.commarea
3381- ${NS} ::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
3382- .vpane.lower add .vpane.lower.diff
3383- .vpane.lower add .vpane.lower.commarea
3384- .vpane add .vpane.lower
3385- if {$use_ttk } {
3386- .vpane.lower pane .vpane.lower.diff -weight 1
3387- .vpane.lower pane .vpane.lower.commarea -weight 0
3388- } else {
3389- .vpane.lower paneconfigure .vpane.lower.diff -stretch always
3390- .vpane.lower paneconfigure .vpane.lower.commarea -stretch never
3391- }
3392- } else {
3393- frame .vpane.lower -height 300 -width 400
3394- frame .vpane.lower.commarea
3395- frame .vpane.lower.diff -relief sunken -borderwidth 1
3396- pack .vpane.lower.diff -fill both -expand 1
3397- pack .vpane.lower.commarea -side bottom -fill x
3398- .vpane add .vpane.lower
3399- .vpane paneconfigure .vpane.lower -sticky nsew
3400- }
3351+ ttk::panedwindow .vpane.lower -orient vertical
3352+ ttk::frame .vpane.lower.commarea
3353+ ttk::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
3354+ .vpane.lower add .vpane.lower.diff
3355+ .vpane.lower add .vpane.lower.commarea
3356+ .vpane add .vpane.lower
3357+ .vpane.lower pane .vpane.lower.diff -weight 1
3358+ .vpane.lower pane .vpane.lower.commarea -weight 0
34013359
34023360# -- Commit Area Buttons
34033361#
3404- ${NS} ::frame .vpane.lower.commarea.buttons
3405- ${NS} ::label .vpane.lower.commarea.buttons.l -text {} \
3362+ ttk ::frame .vpane.lower.commarea.buttons
3363+ ttk ::label .vpane.lower.commarea.buttons.l -text {} \
34063364 -anchor w \
34073365 -justify left
34083366pack .vpane.lower.commarea.buttons.l -side top -fill x
34093367pack .vpane.lower.commarea.buttons -side left -fill y
34103368
3411- ${NS} ::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
3369+ ttk ::button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
34123370 -command ui_do_rescan
34133371pack .vpane.lower.commarea.buttons.rescan -side top -fill x
34143372lappend disable_on_lock \
34153373 {.vpane.lower.commarea.buttons.rescan conf -state}
34163374
3417- ${NS} ::button .vpane.lower.commarea.buttons.incall -text [mc " Stage Changed" ] \
3375+ ttk ::button .vpane.lower.commarea.buttons.incall -text [mc " Stage Changed" ] \
34183376 -command do_add_all
34193377pack .vpane.lower.commarea.buttons.incall -side top -fill x
34203378lappend disable_on_lock \
34213379 {.vpane.lower.commarea.buttons.incall conf -state}
34223380
34233381if {![is_enabled nocommitmsg]} {
3424- ${NS} ::button .vpane.lower.commarea.buttons.signoff -text [mc " Sign Off" ] \
3382+ ttk ::button .vpane.lower.commarea.buttons.signoff -text [mc " Sign Off" ] \
34253383 -command do_signoff
34263384 pack .vpane.lower.commarea.buttons.signoff -side top -fill x
34273385}
34283386
3429- ${NS} ::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
3387+ ttk ::button .vpane.lower.commarea.buttons.commit -text [commit_btn_caption] \
34303388 -command do_commit
34313389pack .vpane.lower.commarea.buttons.commit -side top -fill x
34323390lappend disable_on_lock \
34333391 {.vpane.lower.commarea.buttons.commit conf -state}
34343392
34353393if {![is_enabled nocommit]} {
3436- ${NS} ::button .vpane.lower.commarea.buttons.push -text [mc Push] \
3394+ ttk ::button .vpane.lower.commarea.buttons.push -text [mc Push] \
34373395 -command do_push_anywhere
34383396 pack .vpane.lower.commarea.buttons.push -side top -fill x
34393397}
34403398
34413399# -- Commit Message Buffer
34423400#
3443- ${NS} ::frame .vpane.lower.commarea.buffer
3444- ${NS} ::frame .vpane.lower.commarea.buffer.header
3401+ ttk ::frame .vpane.lower.commarea.buffer
3402+ ttk ::frame .vpane.lower.commarea.buffer.header
34453403set ui_comm .vpane.lower.commarea.buffer.frame.t
34463404set ui_coml .vpane.lower.commarea.buffer.header.l
34473405
34483406if {![is_enabled nocommit]} {
3449- ${NS} ::checkbutton .vpane.lower.commarea.buffer.header.amend \
3407+ ttk ::checkbutton .vpane.lower.commarea.buffer.header.amend \
34503408 -text [mc " Amend Last Commit" ] \
34513409 -variable commit_type_is_amend \
34523410 -command do_select_commit_type
34533411 lappend disable_on_lock \
34543412 [list .vpane.lower.commarea.buffer.header.amend conf -state]
34553413}
34563414
3457- ${NS} ::label $ui_coml \
3415+ ttk ::label $ui_coml \
34583416 -anchor w \
34593417 -justify left
34603418proc trace_commit_type {varname args} {
@@ -3489,10 +3447,10 @@ ttext $ui_comm \
34893447 -font font_diff \
34903448 -xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
34913449 -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
3492- ${NS} ::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
3450+ ttk ::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
34933451 -orient horizontal \
34943452 -command [list $ui_comm xview]
3495- ${NS} ::scrollbar .vpane.lower.commarea.buffer.frame.sby \
3453+ ttk ::scrollbar .vpane.lower.commarea.buffer.frame.sby \
34963454 -orient vertical \
34973455 -command [list $ui_comm yview]
34983456
@@ -3615,9 +3573,9 @@ ttext $ui_diff \
36153573 -yscrollcommand {.vpane.lower.diff.body.sby set} \
36163574 -state disabled
36173575catch {$ui_diff configure -tabstyle wordprocessor}
3618- ${NS} ::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
3576+ ttk ::scrollbar .vpane.lower.diff.body.sbx -orient horizontal \
36193577 -command [list $ui_diff xview]
3620- ${NS} ::scrollbar .vpane.lower.diff.body.sby -orient vertical \
3578+ ttk ::scrollbar .vpane.lower.diff.body.sby -orient vertical \
36213579 -command [list $ui_diff yview]
36223580pack .vpane.lower.diff.body.sbx -side bottom -fill x
36233581pack .vpane.lower.diff.body.sby -side right -fill y
@@ -3918,29 +3876,14 @@ proc on_ttk_pane_mapped {w pane pos} {
39183876 bind $w <Map> {}
39193877 after 0 [list after idle [list $w sashpos $pane $pos ]]
39203878}
3921- proc on_tk_pane_mapped {w pane x y} {
3922- bind $w <Map> {}
3923- after 0 [list after idle [list $w sash place $pane $x $y ]]
3924- }
39253879proc on_application_mapped {} {
3926- global repo_config use_ttk
3880+ global repo_config
39273881 bind . <Map> {}
39283882 set gm $repo_config(gui.geometry)
3929- if {$use_ttk } {
3930- bind .vpane <Map> \
3931- [list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
3932- bind .vpane.files <Map> \
3933- [list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
3934- } else {
3935- bind .vpane <Map> \
3936- [list on_tk_pane_mapped %W 0 \
3937- [lindex $gm 1] \
3938- [lindex [.vpane sash coord 0] 1]]
3939- bind .vpane.files <Map> \
3940- [list on_tk_pane_mapped %W 0 \
3941- [lindex [.vpane.files sash coord 0] 0] \
3942- [lindex $gm 2]]
3943- }
3883+ bind .vpane <Map> \
3884+ [list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
3885+ bind .vpane.files <Map> \
3886+ [list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
39443887 wm geometry . [lindex $gm 0]
39453888}
39463889if {[info exists repo_config(gui.geometry)]} {
0 commit comments