Tk Source Code

Artifact [b0469364]
Login

Artifact b04693648b75a92b1654cfe8db12bb2ee5b617fe694116f1e2636dc15fd6fac5:

Attachment "tk-button-diff" to ticket [6286fda7] added by anonymous 2019-04-15 15:24:24. (unpublished)
diff -u tk8.6.9/library/button.tcl\~ tk8.6.9/library/button.tcl
--- tk8.6.9/library/button.tcl~	2018-10-09 21:19:56.000000000 +0200
+++ tk8.6.9/library/button.tcl	2019-04-15 17:04:31.177647637 +0200
@@ -748,11 +748,14 @@
 	$w configure -state normal
     }
 
-    # Restore the original button "selected" color; assume that the user
-    # wasn't monkeying around with things too much.
+    # Restore the original button "selected" color; but only if the user
+    # has not changed it in the meantime
 
     if {![$w cget -indicatoron] && [info exist Priv($w,selectcolor)]} {
-	$w configure -selectcolor $Priv($w,selectcolor)
+	if {[$w cget -selectcolor] eq $Priv($w,selectcolor)
+	    || ([info exist Priv($w,aselectcolor)] && [$w cget -selectcolor] eq $Priv($w,aselectcolor))} {
+	    $w configure -selectcolor $Priv($w,selectcolor)
+	}
     }
     unset -nocomplain Priv($w,selectcolor) Priv($w,aselectcolor)
 

Diff finished.  Mon Apr 15 17:19:24 2019