]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-gui: remove unreachable Tk 8.4 code
authorMark Levedahl <mlevedahl@gmail.com>
Fri, 16 Feb 2024 23:24:06 +0000 (18:24 -0500)
committerMark Levedahl <mlevedahl@gmail.com>
Sat, 19 Jul 2025 03:48:34 +0000 (23:48 -0400)
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 <mlevedahl@gmail.com>
git-gui.sh
lib/blame.tcl
lib/diff.tcl
lib/sshkey.tcl

index fc224e0a34a7cd7d21f7635c5e89f39dcdfd8d44..2b5d84a56e0166f002b8c921e4d1dfd758b627e2 100755 (executable)
@@ -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
index d6fd8bea91ff531cbec890c13523de575efc46ca..a07aefbdccc6412d7f893d16f459affbff836891 100644 (file)
@@ -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 .
index 84f0468c7c219abafb47529586754ce16d479f43..9df555c505237ba7e1796f902e38f8fef768f92a 100644 (file)
@@ -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}]
        }
 }
 
index c3e681b899064cc2b412dfffddb3d64a67aa9f33..507e1f797ecb75997f779914f3af3a2cd4aa483f 100644 (file)
@@ -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] \