* 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. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@474 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
committed by
Alexandre Deckner
parent
b9d4b634f6
commit
d5c4471790
@@ -136,8 +136,11 @@ TabContainerView::MouseDown(BPoint where)
|
|||||||
if (fLastMouseEventTab)
|
if (fLastMouseEventTab)
|
||||||
fLastMouseEventTab->MouseDown(where, buttons);
|
fLastMouseEventTab->MouseDown(where, buttons);
|
||||||
else {
|
else {
|
||||||
if (clicks > 1)
|
if ((buttons & B_TERTIARY_MOUSE_BUTTON) != 0) {
|
||||||
fClickCount++;
|
// Middle click outside tabs should always open a new tab.
|
||||||
|
fClickCount = 2;
|
||||||
|
} else if (clicks > 1)
|
||||||
|
fClickCount = fClickCount++;
|
||||||
else
|
else
|
||||||
fClickCount = 1;
|
fClickCount = 1;
|
||||||
}
|
}
|
||||||
@@ -148,15 +151,16 @@ void
|
|||||||
TabContainerView::MouseUp(BPoint where)
|
TabContainerView::MouseUp(BPoint where)
|
||||||
{
|
{
|
||||||
fMouseDown = false;
|
fMouseDown = false;
|
||||||
if (fLastMouseEventTab)
|
if (fLastMouseEventTab) {
|
||||||
fLastMouseEventTab->MouseUp(where);
|
fLastMouseEventTab->MouseUp(where);
|
||||||
else if (fClickCount > 1) {
|
fClickCount = 0;
|
||||||
|
} else if (fClickCount > 1) {
|
||||||
// NOTE: fClickCount is >= 1 only if the first click was outside
|
// NOTE: fClickCount is >= 1 only if the first click was outside
|
||||||
// any tab. So even if fLastMouseEventTab has been reset to NULL
|
// any tab. So even if fLastMouseEventTab has been reset to NULL
|
||||||
// because this tab was removed during mouse down, we wouldn't
|
// because this tab was removed during mouse down, we wouldn't
|
||||||
// run the "outside tabs" code below.
|
// run the "outside tabs" code below.
|
||||||
fClickCount = 0;
|
|
||||||
fController->DoubleClickOutsideTabs();
|
fController->DoubleClickOutsideTabs();
|
||||||
|
fClickCount = 0;
|
||||||
}
|
}
|
||||||
// Always check the tab under the mouse again, since we don't update
|
// Always check the tab under the mouse again, since we don't update
|
||||||
// it with fMouseDown == true.
|
// it with fMouseDown == true.
|
||||||
|
|||||||
Reference in New Issue
Block a user