git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriele Mazzotta <gabriele.mzt@gmail.com>
To: git@vger.kernel.org
Cc: paulus@samba.org, Gabriele Mazzotta <gabriele.mzt@gmail.com>
Subject: [PATCH] gitk: Enable mouse horizontal scrolling in diff pane
Date: Sat, 15 Nov 2014 15:05:06 +0100	[thread overview]
Message-ID: <1416060306-4048-1-git-send-email-gabriele.mzt@gmail.com> (raw)

Currently it's required to hold Shift and scroll up and down to move
horizontally. Listen to Button-6 and Button-7 events too to make
horizontal scrolling handier with touchpads and some mice.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
 gitk-git/gitk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 78358a7..95a98e3 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2516,6 +2516,13 @@ proc makewindow {} {
     } else {
 	bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
 	bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
+        bind $ctext <Button> {
+            if {"%b" eq 6} {
+                $ctext xview scroll -5 units
+            } elseif {"%b" eq 7} {
+                $ctext xview scroll 5 units
+            }
+        }
         if {[tk windowingsystem] eq "aqua"} {
             bindall <MouseWheel> {
                 set delta [expr {- (%D)}]
-- 
2.1.3

             reply	other threads:[~2014-11-15 14:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-15 14:05 Gabriele Mazzotta [this message]
2014-11-16  8:00 ` [PATCH] gitk: Enable mouse horizontal scrolling in diff pane Stefan Haller
2015-03-22  3:37 ` Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416060306-4048-1-git-send-email-gabriele.mzt@gmail.com \
    --to=gabriele.mzt@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).