threads / patch / 22497

patchgitk: Add shortcut Ctrl-W for closing the active window

Subject: [PATCH] gitk: Add shortcut Ctrl-W for closing the active window

## tl;dr

3 messages between Feb 2, 2010 and Feb 2, 2010. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Jens Lehmann· Feb 2, 2010, 22:11 UTC · lore

To make the user experience between git gui and gitk more homogeneous, use Ctrl-W in gitk too for closing the active window. When closing the main window doquit is called for proper cleanup.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
Found myself hitting Ctrl-W in gitk with no effect once too often ;-)
 gitk-git/gitk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Show changes to gitk-git/gitk +3 −0
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 03dd0f4..9629394 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2383,6 +2383,8 @@ proc makewindow {} {
     }
     bindall <$::BM> "canvscan mark %W %x %y"
     bindall <B$::BM-Motion> "canvscan dragto %W %x %y"
+    bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
+    bind . <$M1B-Key-w> doquit
     bindkey <Home> selfirstline
     bindkey <End> sellastline
     bind . <Key-Up> "selnextline -1"
@@ -2814,6 +2816,7 @@ proc keys {} {
 [mc "Gitk key bindings:"]

 [mc "<%s-Q>		Quit" $M1T]
+[mc "<%s-W>		Close window" $M1T]
 [mc "<Home>		Move to first commit"]
 [mc "<End>		Move to last commit"]
 [mc "<Up>, p, i	Move up one commit"]
-- 
1.7.0.rc1.173.gc7c5.dirty
Chris Frey· Feb 2, 2010, 23:51 UTC · re: Jens Lehmann · lore

Re: [PATCH] gitk: Add shortcut Ctrl-W for closing the active window

On Tue, Feb 02, 2010 at 11:11:28PM +0100, Jens Lehmann wrote:
> To make the user experience between git gui and gitk more homogeneous, use
> Ctrl-W in gitk too for closing the active window. When closing the main
> window doquit is called for proper cleanup.

This is sort of like when Mozilla claims Ctrl-U to show the page source, and you're expecting it to clear the line.

At least in Mozilla, you can configure the browser to respect the old meanings for Ctrl-U, etc.

- Chris

← back to recent threads