]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-gui: remove non-ttk code
authorMark Levedahl <mlevedahl@gmail.com>
Tue, 20 May 2025 17:53:52 +0000 (13:53 -0400)
committerMark Levedahl <mlevedahl@gmail.com>
Mon, 21 Jul 2025 15:59:21 +0000 (11:59 -0400)
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>
26 files changed:
git-gui.sh
lib/about.tcl
lib/branch_checkout.tcl
lib/branch_create.tcl
lib/branch_delete.tcl
lib/branch_rename.tcl
lib/browser.tcl
lib/choose_font.tcl
lib/choose_repository.tcl
lib/choose_rev.tcl
lib/class.tcl
lib/console.tcl
lib/database.tcl
lib/error.tcl
lib/index.tcl
lib/line.tcl
lib/merge.tcl
lib/option.tcl
lib/remote_add.tcl
lib/remote_branch_delete.tcl
lib/search.tcl
lib/sshkey.tcl
lib/status_bar.tcl
lib/themed.tcl
lib/tools_dlg.tcl
lib/transport.tcl

index 67d51126e71476b74ea41051a382ecd9d2641524..9beb24e28ea56b9df692f5e47e4cf04e3032241b 100755 (executable)
@@ -912,9 +912,6 @@ proc apply_config {} {
                font configure ${font}italic -slant italic
        }
 
-       global use_ttk NS
-       set use_ttk 1
-       set NS ttk
        bind [winfo class .] <<ThemeChanged>> [list InitTheme]
        pave_toplevel .
        color::sync_with_theme
@@ -2313,7 +2310,7 @@ proc do_quit {{rc {1}}} {
        global ui_comm is_quitting repo_config commit_type
        global GITGUI_BCK_exists GITGUI_BCK_i
        global ui_comm_spell
-       global ret_code use_ttk
+       global ret_code
 
        if {$is_quitting} return
        set is_quitting 1
@@ -2371,13 +2368,8 @@ proc do_quit {{rc {1}}} {
                }
                set cfg_geometry [list]
                lappend cfg_geometry [wm geometry .]
-               if {$use_ttk} {
-                       lappend cfg_geometry [.vpane sashpos 0]
-                       lappend cfg_geometry [.vpane.files sashpos 0]
-               } else {
-                       lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
-                       lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
-               }
+               lappend cfg_geometry [.vpane sashpos 0]
+               lappend cfg_geometry [.vpane.files sashpos 0]
                if {[catch {set rc_geometry $repo_config(gui.geometry)}]} {
                        set rc_geometry {}
                }
@@ -3260,7 +3252,6 @@ default {
 # -- Branch Control
 #
 ttk::frame .branch
-if {!$use_ttk} {.branch configure -borderwidth 1 -relief sunken}
 ttk::label .branch.l1 \
        -text [mc "Current Branch:"] \
        -anchor w \
@@ -3277,11 +3268,7 @@ pack .branch -side top -fill x
 #
 ttk::panedwindow .vpane -orient horizontal
 ttk::panedwindow .vpane.files -orient vertical
-if {$use_ttk} {
-       .vpane add .vpane.files
-} else {
-       .vpane add .vpane.files -sticky nsew -height 100 -width 200
-}
+.vpane add .vpane.files
 pack .vpane -anchor n -side top -fill both -expand 1
 
 # -- Working Directory File List
@@ -3331,10 +3318,6 @@ pack $ui_index -side left -fill both -expand 1
 #
 .vpane.files add .vpane.files.workdir
 .vpane.files add .vpane.files.index
-if {!$use_ttk} {
-       .vpane.files paneconfigure .vpane.files.workdir -sticky news
-       .vpane.files paneconfigure .vpane.files.index -sticky news
-}
 
 proc set_selection_colors {w has_focus} {
        foreach tag [list in_diff in_sel] {
@@ -3361,13 +3344,8 @@ ttk::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
 .vpane.lower add .vpane.lower.diff
 .vpane.lower add .vpane.lower.commarea
 .vpane add .vpane.lower
-if {$use_ttk} {
-       .vpane.lower pane .vpane.lower.diff -weight 1
-       .vpane.lower pane .vpane.lower.commarea -weight 0
-} else {
-       .vpane.lower paneconfigure .vpane.lower.diff -stretch always
-       .vpane.lower paneconfigure .vpane.lower.commarea -stretch never
-}
+.vpane.lower pane .vpane.lower.diff -weight 1
+.vpane.lower pane .vpane.lower.commarea -weight 0
 
 # -- Commit Area Buttons
 #
@@ -3888,29 +3866,14 @@ proc on_ttk_pane_mapped {w pane pos} {
        bind $w <Map> {}
        after 0 [list after idle [list $w sashpos $pane $pos]]
 }
-proc on_tk_pane_mapped {w pane x y} {
-       bind $w <Map> {}
-       after 0 [list after idle [list $w sash place $pane $x $y]]
-}
 proc on_application_mapped {} {
-       global repo_config use_ttk
+       global repo_config
        bind . <Map> {}
        set gm $repo_config(gui.geometry)
-       if {$use_ttk} {
-               bind .vpane <Map> \
-                       [list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
-               bind .vpane.files <Map> \
-                       [list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
-       } else {
-               bind .vpane <Map> \
-                       [list on_tk_pane_mapped %W 0 \
-                       [lindex $gm 1] \
-                       [lindex [.vpane sash coord 0] 1]]
-               bind .vpane.files <Map> \
-                       [list on_tk_pane_mapped %W 0 \
-                       [lindex [.vpane.files sash coord 0] 0] \
-                       [lindex $gm 2]]
-       }
+       bind .vpane <Map> \
+               [list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
+       bind .vpane.files <Map> \
+               [list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
        wm geometry . [lindex $gm 0]
 }
 if {[info exists repo_config(gui.geometry)]} {
index 7c32482d632993077ab16ee0934c28650f7d8f04..90fda3915d4937fa59b6c2f572a02edb1171b9d0 100644 (file)
@@ -4,7 +4,7 @@
 proc do_about {} {
        global appvers copyright oguilib
        global tcl_patchLevel tk_patchLevel
-       global ui_comm_spell use_ttk
+       global ui_comm_spell
 
        set w .about_dialog
        Dialog $w
index 756ced9ffac854ed0b671e96e26980d52fe95a07..1e6b757b355f45c07a7d427475511434d3c917a3 100644 (file)
@@ -10,7 +10,6 @@ field opt_fetch     1; # refetch tracking branch if used?
 field opt_detach    0; # force a detached head case?
 
 constructor dialog {} {
-       global use_ttk
        make_dialog top w
        wm withdraw $w
        wm title $top [mc "%s (%s): Checkout Branch" [appname] [reponame]]
index bb4676ddb957f64424bfe0fd7398544af1586b57..9fded28b5c5554e655ebb9c34d1c980459c99b79 100644 (file)
@@ -16,7 +16,7 @@ field opt_fetch     1; # refetch tracking branch if used?
 field reset_ok      0; # did the user agree to reset?
 
 constructor dialog {} {
-       global repo_config use_ttk
+       global repo_config
 
        make_dialog top w
        wm withdraw $w
@@ -44,7 +44,6 @@ constructor dialog {} {
                -text [mc "Name:"] \
                -value user \
                -variable @name_type
-       if {!$use_ttk} {$w.desc.name_r configure -anchor w}
        set w_name $w.desc.name_t
        ttk::entry $w_name \
                -width 40 \
@@ -57,7 +56,6 @@ constructor dialog {} {
                -text [mc "Match Tracking Branch Name"] \
                -value match \
                -variable @name_type
-       if {!$use_ttk} {$w.desc.match_r configure -anchor w}
        grid $w.desc.match_r -sticky we -padx {0 5} -columnspan 2
 
        grid columnconfigure $w.desc 1 -weight 1
index 32979d46fdcc5294a79e7695ec93cfb1115329e3..deac74a644a07cf3c6aedc6814dee36b3c34aa0e 100644 (file)
@@ -9,7 +9,7 @@ field w_check         ; # revision picker for merge test
 field w_delete        ; # delete button
 
 constructor dialog {} {
-       global current_branch use_ttk
+       global current_branch
 
        make_dialog top w
        wm withdraw $w
index d31a3de59f86537ffeb712bd122dcca5b7d0613f..7a3b39d6a3011df41ac812af8b3750c0f547c9ca 100644 (file)
@@ -8,7 +8,7 @@ field oldname
 field newname
 
 constructor dialog {} {
-       global current_branch use_ttk
+       global current_branch
 
        make_dialog top w
        wm withdraw $w
@@ -36,12 +36,8 @@ constructor dialog {} {
 
        ttk::frame $w.rename
        ttk::label $w.rename.oldname_l -text [mc "Branch:"]
-       if {$use_ttk} {
-               ttk::combobox $w.rename.oldname_m -textvariable @oldname \
-                       -values [load_all_heads] -state readonly
-       } else {
-               eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
-       }
+       ttk::combobox $w.rename.oldname_m -textvariable @oldname \
+               -values [load_all_heads] -state readonly
 
        ttk::label $w.rename.newname_l -text [mc "New Name:"]
        ttk::entry $w.rename.newname_t \
index 2b8535715c79551dbccb22f74f7f49b9308f9a59..f53eb952cf3ff4711025921e5b3b45ff9945aed1 100644 (file)
@@ -21,7 +21,7 @@ field browser_busy   1
 field ls_buf     {}; # Buffered record output from ls-tree
 
 constructor new {commit {path {}}} {
-       global cursor_ptr M1B use_ttk
+       global cursor_ptr M1B
        make_dialog top w
        wm withdraw $top
        wm title $top [mc "%s (%s): File Browser" [appname] [reponame]]
@@ -40,7 +40,6 @@ constructor new {commit {path {}}} {
                -anchor w \
                -justify left \
                -font font_uibold
-       if {!$use_ttk} { $w.path configure -borderwidth 1 -relief sunken}
        pack $w.path -anchor w -side top -fill x
 
        ttk::frame $w.list
@@ -66,7 +65,6 @@ constructor new {commit {path {}}} {
                -textvariable @browser_status \
                -anchor w \
                -justify left
-       if {!$use_ttk} { $w.status configure -borderwidth 1 -relief sunken}
        pack $w.status -anchor w -side bottom -fill x
 
        bind $w_list <Button-1>        "[cb _click 0 @%x,%y];break"
@@ -269,7 +267,6 @@ field w              ; # widget path
 field w_rev          ; # mega-widget to pick the initial revision
 
 constructor dialog {} {
-       global use_ttk
        make_dialog top w
        wm withdraw $top
        wm title $top [mc "%s (%s): Browse Branch Files" [appname] [reponame]]
index 01b9ba5abf053f5b42ce7aa397f2e50818fa2817..a90908a8ec3bfdf2809f0452f0b0c88ca6128a1b 100644 (file)
@@ -17,7 +17,6 @@ variable all_families [list]  ; # All fonts known to Tk
 
 constructor pick {path title a_family a_size} {
        variable all_families
-       global use_ttk
 
        set v_family $a_family
        set v_size $a_size
index e71ec1732d81f980e388e9318951593e22e96ee0..866161548bad0e80eeee0b57f6153dbce7f4eb46 100644 (file)
@@ -35,7 +35,7 @@ field readtree_err        ; # Error output from read-tree (if any)
 field sorted_recent       ; # recent repositories (sorted)
 
 constructor pick {} {
-       global M1T M1B use_ttk
+       global M1T M1B
 
        if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
                set maxrecent 10
@@ -378,7 +378,6 @@ proc _objdir {path} {
 ## Create New Repository
 
 method _do_new {} {
-       global use_ttk
        $w_next conf \
                -state disabled \
                -command [cb _do_new2] \
@@ -462,7 +461,6 @@ proc _new_ok {p} {
 ## Clone Existing Repository
 
 method _do_clone {} {
-       global use_ttk
        $w_next conf \
                -state disabled \
                -command [cb _do_clone2] \
index c1034eae1116a95bac58c534c6362e09d14ad68e..7a9e3c83bb906921eabb6762a78e31856d4fcfdc 100644 (file)
@@ -32,7 +32,7 @@ proc new_unmerged {path {title {}}} {
 }
 
 constructor _new {path unmerged_only title} {
-       global current_branch is_detached use_ttk
+       global current_branch is_detached
 
        if {![info exists ::all_remotes]} {
                load_all_remotes
@@ -52,7 +52,6 @@ constructor _new {path unmerged_only title} {
                        -text [mc "This Detached Checkout"] \
                        -value HEAD \
                        -variable @revtype
-               if {!$use_ttk} {$w.detachedhead_r configure -anchor w}
                grid $w.detachedhead_r -sticky we -padx {0 5} -columnspan 2
        }
 
@@ -95,11 +94,7 @@ constructor _new {path unmerged_only title} {
                ] -side right
        grid $w.types -sticky we -padx {0 5} -columnspan 2
 
-       if {$use_ttk} {
-               ttk::frame $w.list -style SListbox.TFrame -padding 2
-       } else {
-               frame $w.list
-       }
+       ttk::frame $w.list -style SListbox.TFrame -padding 2
        set w_list $w.list.l
        listbox $w_list \
                -font font_diff \
@@ -109,9 +104,7 @@ constructor _new {path unmerged_only title} {
                -exportselection false \
                -xscrollcommand [cb _sb_set $w.list.sbx h] \
                -yscrollcommand [cb _sb_set $w.list.sby v]
-       if {$use_ttk} {
-               $w_list configure -relief flat -highlightthickness 0 -borderwidth 0
-       }
+       $w_list configure -relief flat -highlightthickness 0 -borderwidth 0
        pack $w_list -fill both -expand 1
        grid $w.list -sticky nswe -padx {20 5} -columnspan 2
        bind $w_list <Any-Motion>  [cb _show_tooltip @%x,%y]
@@ -238,12 +231,10 @@ constructor _new {path unmerged_only title} {
 }
 
 method none {text} {
-       global use_ttk
        if {![winfo exists $w.none_r]} {
                ttk::radiobutton $w.none_r \
                        -value none \
                        -variable @revtype
-               if {!$use_ttk} {$w.none_r configure -anchor w}
                grid $w.none_r -sticky we -padx {0 5} -columnspan 2
        }
        $w.none_r configure -text $text
index f08506f3834a1ec821390190b920146d83078997..0b1e67103ff82e5cb6a95fa43a672a2e44fff683 100644 (file)
@@ -136,7 +136,6 @@ proc delete_this {{t {}}} {
 
 proc make_dialog {t w args} {
        upvar $t top $w pfx this this
-       global use_ttk
        uplevel [linsert $args 0 make_toplevel $t $w]
        catch {wm attributes $top -type dialog}
        pave_toplevel $pfx
index ad6804bc34d39886961df37b78a107dfe8538d5d..267699408c0d3cd86eab55c719af72b72933ff6a 100644 (file)
@@ -27,7 +27,7 @@ constructor embed {path title} {
 }
 
 method _init {} {
-       global M1B use_ttk
+       global M1B
 
        if {$is_toplevel} {
                make_dialog top w -autodelete 0
index 8f200369a2a5bed35059aaa16d4fab6f50172527..78732d8651a8d477d906717dceb544ad8058b347 100644 (file)
@@ -2,7 +2,6 @@
 # Copyright (C) 2006, 2007 Shawn Pearce
 
 proc do_stats {} {
-       global use_ttk
        set fd [git_read [list count-objects -v]]
        while {[gets $fd line] > 0} {
                if {[regexp {^([^:]+): (\d+)$} $line _ name value]} {
index 4e95b407bd70e126938fb3530a1fd6e28226c584..fc0b5ad5e056671022115241056194cc804353e0 100644 (file)
@@ -71,7 +71,6 @@ proc ask_popup {msg} {
 }
 
 proc hook_failed_popup {hook msg {is_fatal 1}} {
-       global use_ttk
        set w .hookfail
        Dialog $w
        wm withdraw $w
index ffede7bde2b00cd1ac4d9be6cf645009ff057235..377547034b7d49dfa013c8d63e81e3fbc282eace 100644 (file)
@@ -22,8 +22,6 @@ proc _close_updateindex {fd} {
 }
 
 proc rescan_on_error {err {after {}}} {
-       global use_ttk
-
        set w .indexfried
        Dialog $w
        wm withdraw $w
index 62eae258ee61190a5e468ea504cd630a150016b5..5980ae805c6f9191aae96806cc1f129a5d130ee1 100644 (file)
@@ -9,7 +9,6 @@ field ctext
 field linenum   {}
 
 constructor new {i_w i_text args} {
-       global use_ttk
        set w      $i_w
        set ctext  $i_text
 
index dfdd28b80f59b3c9738d83fd4863c624ab6ab19e..61524ec9cad0d3ed7b4cef54012e96b14b03e248 100644 (file)
@@ -145,7 +145,7 @@ method _finish {cons ok} {
 
 constructor dialog {} {
        global current_branch
-       global M1B use_ttk
+       global M1B
 
        if {![_can_merge $this]} {
                delete_this
index 888e9dbc2a5527550d07244badbed7ba5c62bff3..487d70691d77d0ea3d18776160b8664293a730ca 100644 (file)
@@ -91,7 +91,7 @@ proc save_config {} {
 proc do_options {} {
        global repo_config global_config font_descs
        global repo_config_new global_config_new
-       global ui_comm_spell use_ttk
+       global ui_comm_spell
 
        array unset repo_config_new
        array unset global_config_new
@@ -218,15 +218,9 @@ proc do_options {} {
                                set opts [eval [lindex $option 3]]
                                ttk::frame $w.$f.$optid
                                ttk::label $w.$f.$optid.l -text [mc "%s:" $text]
-                               if {$use_ttk} {
-                                       ttk::combobox $w.$f.$optid.v \
-                                               -textvariable ${f}_config_new($name) \
-                                               -values $opts -state readonly
-                               } else {
-                                       eval tk_optionMenu $w.$f.$optid.v \
-                                               ${f}_config_new($name) \
-                                               $opts
-                               }
+                               ttk::combobox $w.$f.$optid.v \
+                                       -textvariable ${f}_config_new($name) \
+                                       -values $opts -state readonly
                                pack $w.$f.$optid.l -side left -anchor w -fill x
                                pack $w.$f.$optid.v -side right -anchor e -padx 5
                                pack $w.$f.$optid -side top -anchor w -fill x
@@ -252,15 +246,9 @@ proc do_options {} {
 
                ttk::frame $w.$f.$optid
                ttk::label $w.$f.$optid.l -text [mc "Spelling Dictionary:"]
-               if {$use_ttk} {
-                       ttk::combobox $w.$f.$optid.v \
-                               -textvariable ${f}_config_new(gui.spellingdictionary) \
-                               -values $all_dicts -state readonly
-               } else {
-                       eval tk_optionMenu $w.$f.$optid.v \
-                               ${f}_config_new(gui.spellingdictionary) \
-                               $all_dicts
-               }
+               ttk::combobox $w.$f.$optid.v \
+                       -textvariable ${f}_config_new(gui.spellingdictionary) \
+                       -values $all_dicts -state readonly
                pack $w.$f.$optid.l -side left -anchor w -fill x
                pack $w.$f.$optid.v -side right -anchor e -padx 5
                pack $w.$f.$optid -side top -anchor w -fill x
index a8a57b85b0e14a75a701e0602249385702dd512e..bff1376cb3332f31e34fb4bf8f688a48864795b7 100644 (file)
@@ -13,7 +13,7 @@ field location     {}; # location of the remote the user has chosen
 field opt_action fetch; # action to do after registering the remote locally
 
 constructor dialog {} {
-       global repo_config use_ttk
+       global repo_config
 
        make_dialog top w
        wm withdraw $top
index 4d529f3d183fc314ea37dae20745803f2ce92455..a07f367410015d0f36b395e96c7f9488d41d5874 100644 (file)
@@ -23,7 +23,7 @@ field full_cache
 field cached
 
 constructor dialog {} {
-       global all_remotes M1B use_ttk
+       global all_remotes M1B
 
        make_dialog top w
        wm title $top [mc "%s (%s): Delete Branch Remotely" [appname] [reponame]]
@@ -51,12 +51,8 @@ constructor dialog {} {
                        -text [mc "Remote:"] \
                        -value remote \
                        -variable @urltype
-               if {$use_ttk} {
-                       ttk::combobox $w.dest.remote_m -textvariable @remote \
-                               -values $all_remotes -state readonly
-               } else {
-                       eval tk_optionMenu $w.dest.remote_m @remote $all_remotes
-               }
+               ttk::combobox $w.dest.remote_m -textvariable @remote \
+                       -values $all_remotes -state readonly
                grid $w.dest.remote_r $w.dest.remote_m -sticky w
                if {[lsearch -sorted -exact $all_remotes origin] != -1} {
                        set remote origin
index a80159846502bdbace2283c693868d11559ee9e7..47a0d8c96188a383c58f9e611386d3ed5e18ad18 100644 (file)
@@ -21,7 +21,6 @@ field smarktop
 field smarkbot
 
 constructor new {i_w i_text args} {
-       global use_ttk
        set w      $i_w
        set ctext  $i_text
 
index 6caf1fd4584e57a743d59193a7a569614c2731d2..7a6526d3dbd9999a0b27e1d10ef003adcbf03cb8 100644 (file)
@@ -18,7 +18,7 @@ proc find_ssh_key {} {
 }
 
 proc do_ssh_key {} {
-       global sshkey_title sshkey_fd use_ttk
+       global sshkey_title sshkey_fd
 
        set w .sshkey_dialog
        if {[winfo exists $w]} {
@@ -48,8 +48,7 @@ proc do_ssh_key {} {
 
        text $w.contents -width 60 -height 10 -wrap char -relief sunken
        pack $w.contents -fill both -expand 1
-       set clr darkblue
-       if {$use_ttk} { set clr [ttk::style lookup . -selectbackground] }
+       set clr [ttk::style lookup . -selectbackground]
        $w.contents configure -inactiveselectbackground $clr
 
        ttk::frame $w.buttons
index d2e04ac427cef08efe8e9461f481d60f0a92049f..f5c0204a2d5d587d990416ed758fa4d47d83ce1a 100644 (file)
@@ -39,7 +39,6 @@ field operations ; # list of current ongoing operations
 field completed_operation_count
 
 constructor new {path} {
-       global use_ttk
        set w $path
        set w_l $w.l
        set w_c $w.c
@@ -52,9 +51,6 @@ constructor new {path} {
        set completed_operation_count 0
 
        ttk::frame $w
-       if {!$use_ttk} {
-               $w configure -borderwidth 1 -relief sunken
-       }
        ttk::label $w_l \
                -textvariable @status_bar_text \
                -anchor w \
index e9688527e52001ea1f3fc85cb7a1d22f164ff75f..8c4a0c2ee7a0deb86f0523cadded326bd07b6725 100644 (file)
@@ -190,8 +190,7 @@ proc InitEntryFrame {} {
 }
 
 proc gold_frame {w args} {
-       global use_ttk
-       if {$use_ttk && ![is_MacOSX]} {
+       if {![is_MacOSX]} {
                eval [linsert $args 0 ttk::frame $w -style Gold.TFrame]
        } else {
                eval [linsert $args 0 frame $w -background gold]
@@ -199,8 +198,7 @@ proc gold_frame {w args} {
 }
 
 proc tlabel {w args} {
-       global use_ttk
-       if {$use_ttk && ![is_MacOSX]} {
+       if {![is_MacOSX]} {
                set cmd [list ttk::label $w -style Color.TLabel]
                foreach {k v} $args {
                        switch -glob -- $k {
@@ -216,17 +214,7 @@ proc tlabel {w args} {
 
 # The padded label gets used in the about class.
 proc paddedlabel {w args} {
-       global use_ttk
-       if {$use_ttk} {
-               eval [linsert $args 0 ttk::label $w -style Padded.TLabel]
-       } else {
-               eval [linsert $args 0 label $w \
-                                 -padx 5 -pady 5 \
-                                 -justify left \
-                                 -anchor w \
-                                 -borderwidth 1 \
-                                 -relief solid]
-       }
+       eval [linsert $args 0 ttk::label $w -style Padded.TLabel]
 }
 
 # Create a toplevel for use as a dialog.
@@ -242,8 +230,7 @@ proc Dialog {w args} {
 # Tk toplevels are not themed - so pave it over with a themed frame to get
 # the base color correct per theme.
 proc pave_toplevel {w} {
-       global use_ttk
-       if {$use_ttk && ![winfo exists $w.!paving]} {
+       if {![winfo exists $w.!paving]} {
                set paving [ttk::frame $w.!paving]
                place $paving -x 0 -y 0 -relwidth 1 -relheight 1
                lower $paving
@@ -254,19 +241,10 @@ proc pave_toplevel {w} {
 # On many themes the border for a scrolled listbox needs to go around the
 # listbox and the scrollbar.
 proc slistbox {w args} {
-       global use_ttk
-       if {$use_ttk} {
-               set f [ttk::frame $w -style SListbox.TFrame -padding 2]
-       } else {
-               set f [frame $w -relief flat]
-       }
+       set f [ttk::frame $w -style SListbox.TFrame -padding 2]
     if {[catch {
-               if {$use_ttk} {
-                       eval [linsert $args 0 listbox $f.list -relief flat \
-                                         -highlightthickness 0 -borderwidth 0]
-               } else {
-                       eval [linsert $args 0 listbox $f.list]
-               }
+               eval [linsert $args 0 listbox $f.list -relief flat \
+                                 -highlightthickness 0 -borderwidth 0]
         ttk::scrollbar $f.vs -command [list $f.list yview]
         $f.list configure -yscrollcommand [list $f.vs set]
         grid $f.list $f.vs -sticky news
@@ -285,67 +263,42 @@ proc slistbox {w args} {
 
 # fetch the background color from a widget.
 proc get_bg_color {w} {
-       global use_ttk
-       if {$use_ttk} {
-               set bg [ttk::style lookup [winfo class $w] -background]
-       } else {
-               set bg [$w cget -background]
-       }
+       set bg [ttk::style lookup [winfo class $w] -background]
        return $bg
 }
 
-# ttk::spinbox didn't get added until 8.6
+# ttk::spinbox
 proc tspinbox {w args} {
-       global use_ttk
-       if {$use_ttk && [llength [info commands ttk::spinbox]] > 0} {
-               eval [linsert $args 0 ttk::spinbox $w]
-       } else {
-               eval [linsert $args 0 spinbox $w]
-       }
+       eval [linsert $args 0 ttk::spinbox $w]
 }
 
 # Create a text widget with any theme specific properties.
 proc ttext {w args} {
-       global use_ttk
-       if {$use_ttk} {
-               switch -- [ttk_get_current_theme] {
-                       "vista" - "xpnative" {
-                               lappend args -highlightthickness 0 -borderwidth 0
-                       }
+       switch -- [ttk_get_current_theme] {
+               "vista" - "xpnative" {
+                       lappend args -highlightthickness 0 -borderwidth 0
                }
        }
        set w [eval [linsert $args 0 text $w]]
-       if {$use_ttk} {
-               if {[winfo class [winfo parent $w]] eq "EntryFrame"} {
-                       bind $w <FocusIn> {[winfo parent %W] state focus}
-                       bind $w <FocusOut> {[winfo parent %W] state !focus}
-               }
+       if {[winfo class [winfo parent $w]] eq "EntryFrame"} {
+               bind $w <FocusIn> {[winfo parent %W] state focus}
+               bind $w <FocusOut> {[winfo parent %W] state !focus}
        }
        return $w
 }
 
 # themed frame suitable for surrounding a text field.
 proc textframe {w args} {
-       global use_ttk
-       if {$use_ttk} {
-               if {[catch {ttk::style layout EntryFrame}]} {
-                       InitEntryFrame
-               }
-               eval [linsert $args 0 ttk::frame $w -class EntryFrame -style EntryFrame]
-       } else {
-               eval [linsert $args 0 frame $w]
+       if {[catch {ttk::style layout EntryFrame}]} {
+               InitEntryFrame
        }
+       eval [linsert $args 0 ttk::frame $w -class EntryFrame -style EntryFrame]
        return $w
 }
 
 proc tentry {w args} {
-       global use_ttk
-       if {$use_ttk} {
-               InitTheme
-               ttk::entry $w -style Edged.Entry
-       } else {
-               entry $w
-       }
+       InitTheme
+       ttk::entry $w -style Edged.Entry
 
        rename $w _$w
        interp alias {} $w {} tentry_widgetproc $w
@@ -353,25 +306,14 @@ proc tentry {w args} {
        return $w
 }
 proc tentry_widgetproc {w cmd args} {
-       global use_ttk
        switch -- $cmd {
                state {
-                       if {$use_ttk} {
-                               return [uplevel 1 [list _$w $cmd] $args]
-                       } else {
-                               if {[lsearch -exact $args pressed] != -1} {
-                                       _$w configure -background lightpink
-                               } else {
-                                       _$w configure -background lightgreen
-                               }
-                       }
+                       return [uplevel 1 [list _$w $cmd] $args]
                }
                configure {
-                       if {$use_ttk} {
-                               if {[set n [lsearch -exact $args -background]] != -1} {
-                                       set args [lreplace $args $n [incr n]]
-                                       if {[llength $args] == 0} {return}
-                               }
+                       if {[set n [lsearch -exact $args -background]] != -1} {
+                               set args [lreplace $args $n [incr n]]
+                               if {[llength $args] == 0} {return}
                        }
                        return [uplevel 1 [list _$w $cmd] $args]
                }
index ddb3092bace71adb0bb1e57aa2eb5c238ee0ace4..73236215b5b82dc2c8e73eb9afa7690ea0cb28bb 100644 (file)
@@ -16,7 +16,7 @@ field ask_branch    0; # ask for a revision
 field ask_args      0; # ask for additional args
 
 constructor dialog {} {
-       global repo_config use_ttk
+       global repo_config
 
        make_dialog top w
        wm title $top [mc "%s (%s): Add Tool" [appname] [reponame]]
@@ -179,7 +179,7 @@ field w              ; # widget path
 field w_names        ; # name list
 
 constructor dialog {} {
-       global repo_config global_config system_config use_ttk
+       global repo_config global_config system_config
 
        load_config 1
 
@@ -272,7 +272,7 @@ field is_ok         0; # ok to start
 field argstr       {}; # arguments
 
 constructor dialog {fullname} {
-       global M1B use_ttk
+       global M1B
 
        set title [get_config "guitool.$fullname.title"]
        if {$title eq {}} {
index a53a6b1a423a61bcb317bfabba45ca76e17e4051..020d09e112ce620ec2adcaaf6acf69fd412078dd 100644 (file)
@@ -120,7 +120,7 @@ trace add variable push_remote write \
 proc do_push_anywhere {} {
        global all_remotes current_branch
        global push_urltype push_remote push_url push_thin push_tags
-       global push_force use_ttk
+       global push_force
 
        set w .push_setup
        toplevel $w
@@ -165,14 +165,10 @@ proc do_push_anywhere {} {
                        -text [mc "Remote:"] \
                        -value remote \
                        -variable push_urltype
-               if {$use_ttk} {
-                       ttk::combobox $w.dest.remote_m -state readonly \
-                               -exportselection false \
-                               -textvariable push_remote \
-                               -values $all_remotes
-               } else {
-                       eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes
-               }
+               ttk::combobox $w.dest.remote_m -state readonly \
+                       -exportselection false \
+                       -textvariable push_remote \
+                       -values $all_remotes
                grid $w.dest.remote_r $w.dest.remote_m -sticky w
                if {[lsearch -sorted -exact $all_remotes origin] != -1} {
                        set push_remote origin