[haiku-webkit-commits] r474 - webkit/trunk/WebKit/haiku/WebPositive/tabview

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Mon, 03 May 2010 12:20:37 +0000

Author: stippi
Date: Mon May  3 12:20:37 2010
New Revision: 474
URL: http://mmlr.dyndns.org/changeset/474

Log:
* Fixed double click outside tabs to only be recognized when the first click
  was outside as well.
* Single tertiary click outside tabs opens new tab on mouse up.
* Reset fClickCount always when the click was inside a tab.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/tabview/TabContainerView.cpp

Modified: webkit/trunk/WebKit/haiku/WebPositive/tabview/TabContainerView.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/tabview/TabContainerView.cpp  Mon May 
 3 11:54:14 2010        (r473)
+++ webkit/trunk/WebKit/haiku/WebPositive/tabview/TabContainerView.cpp  Mon May 
 3 12:20:37 2010        (r474)
@@ -136,8 +136,11 @@
        if (fLastMouseEventTab)
                fLastMouseEventTab->MouseDown(where, buttons);
        else {
-               if (clicks > 1)
-                       fClickCount++;
+               if ((buttons & B_TERTIARY_MOUSE_BUTTON) != 0) {
+                       // Middle click outside tabs should always open a new 
tab.
+                       fClickCount = 2;
+               } else if (clicks > 1)
+                       fClickCount = fClickCount++;
                else
                        fClickCount = 1;
        }
@@ -148,15 +151,16 @@
 TabContainerView::MouseUp(BPoint where)
 {
        fMouseDown = false;
-       if (fLastMouseEventTab)
+       if (fLastMouseEventTab) {
                fLastMouseEventTab->MouseUp(where);
-       else if (fClickCount > 1) {
+               fClickCount = 0;
+       } else if (fClickCount > 1) {
                // NOTE: fClickCount is >= 1 only if the first click was outside
                // any tab. So even if fLastMouseEventTab has been reset to NULL
                // because this tab was removed during mouse down, we wouldn't
                // run the "outside tabs" code below.
-               fClickCount = 0;
                fController->DoubleClickOutsideTabs();
+               fClickCount = 0;
        }
        // Always check the tab under the mouse again, since we don't update
        // it with fMouseDown == true.

Other related posts:

  • » [haiku-webkit-commits] r474 - webkit/trunk/WebKit/haiku/WebPositive/tabview - webkit