Skip to contentSkip to conversation

Fixing gitk indentation

PATCH New Jonathan del Strother 1 participant 3 messages Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 gitk: Added support for OS X mouse wheel

From: Jonathan del Strother <[email protected]>

(Väinö Järvelä supplied this patch a while ago for 1.5.2. It no longer applied cleanly, so I'm reposting it.)

MacBook doesn't seem to recognize MouseRelease-4 and -5 events, at all. So i added a support for the MouseWheel event, which i limited to Tcl/tk aqua, as i couldn't test it neither on Linux or Windows. Tcl/tk needs to be updated from the version that is shipped with OS X 10.4 Tiger, for this patch to work.

---
 gitk |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
gitk +6 -0
index 300fdce..ee2a6f5 100755
@@ -843,6 +843,12 @@ proc makewindow {} {
     } else {
 	bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
 	bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
+        if {[tk windowingsystem] eq "aqua"} {
+            bindall <MouseWheel> {
+                set delta [expr {- (%D)}]
+                allcanvs yview scroll $delta units
+            }
+        }
     }
     bindall <2> "canvscan mark %W %x %y"
     bindall <B2-Motion> "canvscan dragto %W %x %y"
Signature · 1 line
1.5.3.1
#2 lore raw

PATCH 2/2 Fixing gitk indentation

In reply to a message not in the archive

From: Jonathan del Strother <[email protected]>

Just tweaking some minor indentation issues in gitk

---
 gitk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
gitk +4 -4
index ee2a6f5..9b3e627 100755
@@ -838,11 +838,11 @@ proc makewindow {} {
     bindall <1> {selcanvline %W %x %y}
     #bindall <B1-Motion> {selcanvline %W %x %y}
     if {[tk windowingsystem] == "win32"} {
-	bind . <MouseWheel> { windows_mousewheel_redirector %W %X %Y %D }
-	bind $ctext <MouseWheel> { windows_mousewheel_redirector %W %X %Y %D ; break }
+        bind . <MouseWheel> { windows_mousewheel_redirector %W %X %Y %D }
+        bind $ctext <MouseWheel> { windows_mousewheel_redirector %W %X %Y %D ; break }
     } else {
-	bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
-	bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
+        bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
+        bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
         if {[tk windowingsystem] eq "aqua"} {
             bindall <MouseWheel> {
                 set delta [expr {- (%D)}]
Signature · 1 line
1.5.3.1
#3 lore raw

cover gitk: Added support for OS X mouse wheel

In reply to a message not in the archive
Quoted 4 lines · Lars Hjemli

Your patch has been mangled, probably by your MUA.

Also, these -/+ 4 lines seem to only change tab into spaces: please send such cleanups in a separate patch

Alright, let's try again. First patch fixes the mouse wheel, second patch fixes the weird indentation