OSDN Git Service

RAD-81: Ctrl-W closes current tab
authorLatif Khalifa <latifer@streamgrid.net>
Tue, 17 Nov 2009 02:29:36 +0000 (02:29 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Tue, 17 Nov 2009 02:29:36 +0000 (02:29 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@449 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Dialogs/KeyboardShortcuts.resx
Radegast/GUI/Dialogs/MainForm.cs

index 477a64d..9a9fe2e 100644 (file)
@@ -130,6 +130,7 @@ Alt-9: Voice
 
 Ctrl-Tab: Next tab
 Ctrl-Shit-Tab: Previous tab
+Ctrl-W: Close current tab
 
 Ctrl-G: Open map and go to the SLURL in the clipboard
 Ctrl-Shift-H: Teleport Home</value>\r
index 9fded92..7f22dcd 100644 (file)
@@ -497,6 +497,24 @@ namespace Radegast
 \r
         private void frmMain_KeyDown(object sender, KeyEventArgs e)\r
         {\r
+            // Ctrl-W: Close tab\r
+            if (e.Modifiers == Keys.Control && e.KeyCode == Keys.W)\r
+            {\r
+                e.Handled = e.SuppressKeyPress = true;\r
+                RadegastTab tab = tabsConsole.SelectedTab;\r
+                \r
+                if (tab.AllowClose)\r
+                {\r
+                    tab.Close();\r
+                }\r
+                else if (tab.AllowHide)\r
+                {\r
+                    tab.Hide();\r
+                }\r
+\r
+                return;\r
+            }\r
+\r
             // Ctl-Shift-H: Teleport Home\r
             if (e.Modifiers == (Keys.Control | Keys.Shift) && e.KeyCode == Keys.H)\r
             {\r