[sip-comm-dev] [PATCH] closing chat tabs with middle mouse button


#1

Hi

I started working on SIP-Communicator last week and this is my first patch,
so it might be a really small one. On NetBeans, IE, Firefox, we can close
tabs with the middle mouse button. This patch allows SIP-Communicator users
to close chat tabs with the same button.

Index:
src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java

···

===================================================================
---
src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java
(revision 6431)
+++
src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java
(working copy)
@@ -1688,7 +1688,11 @@
                 ((SIPCommTabbedPane) tabPane).fireMaxTabEvent(e,
overTabIndex);
                 return;
             }
-
+ // Allow tabs closing with mouse middle button
+ if (e.getButton() == MouseEvent.BUTTON2) {
+ ((SIPCommTabbedPane) tabPane).fireCloseTabEvent(e,
+ overTabIndex);
+ }
         }

         public void mouseExited(MouseEvent e)


#2

Hey Arnaud,

Thanks for this patch! Even though it may seem as an insignificant feature some of us have been waiting for it for quite a long time.

It's now applied, committed and ack-ed on our contributors page.

Cheers,
Yana

···

On Dec 2, 2009, at 11:22 AM, Arnaud Roemer wrote:

Hi

I started working on SIP-Communicator last week and this is my first patch, so it might be a really small one. On NetBeans, IE, Firefox, we can close tabs with the middle mouse button. This patch allows SIP-Communicator users to close chat tabs with the same button.

Index: src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java

--- src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java (revision 6431)
+++ src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java (working copy)
@@ -1688,7 +1688,11 @@
                 ((SIPCommTabbedPane) tabPane).fireMaxTabEvent(e, overTabIndex);
                 return;
             }
-
+ // Allow tabs closing with mouse middle button
+ if (e.getButton() == MouseEvent.BUTTON2) {
+ ((SIPCommTabbedPane) tabPane).fireCloseTabEvent(e,
+ overTabIndex);
+ }
         }

         public void mouseExited(MouseEvent e)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net