From: Mark Levedahl Date: Fri, 16 Feb 2024 23:24:06 +0000 (-0500) Subject: git-gui: remove unreachable Tk 8.4 code X-Git-Tag: v2.51.0-rc0~46^2~1^2~4 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e3369f0f6125ad58986170b92530e9eff9fbc97;p=thirdparty%2Fgit.git git-gui: remove unreachable Tk 8.4 code git-gui has remnant code to allow some drawing with Tk 8.4 predating the addition of themed widgets. As git-gui requires Tk >= 8.6, this code can never trigger. Remove it. Signed-off-by: Mark Levedahl --- diff --git a/git-gui.sh b/git-gui.sh index fc224e0a34..2b5d84a56e 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1268,8 +1268,6 @@ citool { ## ## execution environment -set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}] - # Suggest our implementation of askpass, if none is set if {![info exists env(SSH_ASKPASS)]} { set env(SSH_ASKPASS) [gitexec git-gui--askpass] @@ -3363,28 +3361,18 @@ unset i # -- Diff and Commit Area # -if {$have_tk85} { - ${NS}::panedwindow .vpane.lower -orient vertical - ${NS}::frame .vpane.lower.commarea - ${NS}::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 - } +${NS}::panedwindow .vpane.lower -orient vertical +${NS}::frame .vpane.lower.commarea +${NS}::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 { - frame .vpane.lower -height 300 -width 400 - frame .vpane.lower.commarea - frame .vpane.lower.diff -relief sunken -borderwidth 1 - pack .vpane.lower.diff -fill both -expand 1 - pack .vpane.lower.commarea -side bottom -fill x - .vpane add .vpane.lower - .vpane paneconfigure .vpane.lower -sticky nsew + .vpane.lower paneconfigure .vpane.lower.diff -stretch always + .vpane.lower paneconfigure .vpane.lower.commarea -stretch never } # -- Commit Area Buttons diff --git a/lib/blame.tcl b/lib/blame.tcl index d6fd8bea91..a07aefbdcc 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -63,7 +63,7 @@ field tooltip_timer {} ; # Current timer event for our tooltip field tooltip_commit {} ; # Commit(s) in tooltip constructor new {i_commit i_path i_jump} { - global cursor_ptr M1B M1T have_tk85 use_ttk NS + global cursor_ptr M1B M1T NS variable active_color variable group_colors @@ -203,9 +203,8 @@ constructor new {i_commit i_path i_jump} { -width 80 \ -xscrollcommand [list $w.file_pane.out.sbx set] \ -font font_diff - if {$have_tk85} { $w_file configure -inactiveselectbackground darkblue - } + $w_file tag conf found \ -background yellow @@ -1298,7 +1297,7 @@ method _open_tooltip {cur_w} { # On MacOS raising a window causes it to acquire focus. # Tk 8.5 on MacOS seems to properly support wm transient, # so we can safely counter the effect there. - if {$::have_tk85 && [is_MacOSX]} { + if {[is_MacOSX]} { update if {$w eq {}} { raise . diff --git a/lib/diff.tcl b/lib/diff.tcl index 84f0468c7c..9df555c505 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -2,15 +2,13 @@ # Copyright (C) 2006, 2007 Shawn Pearce proc apply_tab_size {{firsttab {}}} { - global have_tk85 repo_config ui_diff + global repo_config ui_diff set w [font measure font_diff "0"] - if {$have_tk85 && $firsttab != 0} { + if {$firsttab != 0} { $ui_diff configure -tabs [list [expr {$firsttab * $w}] [expr {($firsttab + $repo_config(gui.tabsize)) * $w}]] - } elseif {$have_tk85 || $repo_config(gui.tabsize) != 8} { - $ui_diff configure -tabs [expr {$repo_config(gui.tabsize) * $w}] } else { - $ui_diff configure -tabs {} + $ui_diff configure -tabs [expr {$repo_config(gui.tabsize) * $w}] } } diff --git a/lib/sshkey.tcl b/lib/sshkey.tcl index c3e681b899..507e1f797e 100644 --- a/lib/sshkey.tcl +++ b/lib/sshkey.tcl @@ -18,7 +18,7 @@ proc find_ssh_key {} { } proc do_ssh_key {} { - global sshkey_title have_tk85 sshkey_fd use_ttk NS + global sshkey_title sshkey_fd use_ttk NS set w .sshkey_dialog if {[winfo exists $w]} { @@ -48,11 +48,9 @@ proc do_ssh_key {} { text $w.contents -width 60 -height 10 -wrap char -relief sunken pack $w.contents -fill both -expand 1 - if {$have_tk85} { - set clr darkblue - if {$use_ttk} { set clr [ttk::style lookup . -selectbackground] } - $w.contents configure -inactiveselectbackground $clr - } + set clr darkblue + if {$use_ttk} { set clr [ttk::style lookup . -selectbackground] } + $w.contents configure -inactiveselectbackground $clr ${NS}::frame $w.buttons ${NS}::button $w.buttons.close -text [mc Close] \