From d20cb765459e09a6ce19135755d9dcc4a4947402 Mon Sep 17 00:00:00 2001 From: "dean_tessman%hotmail.com" Date: Fri, 1 Feb 2002 06:36:28 +0000 Subject: [PATCH] 122057 - springloaded folders trigger too easily r=varga@utcru.sk, sr=ben git-svn-id: svn://10.0.0.236/trunk@113406 18797224-902f-48f8-a5cc-f745e15eee43 --- .../base/src/outliner/src/nsOutlinerBodyFrame.cpp | 15 +++++---------- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 15 +++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp index 53c42613847..f76b0b7a3bb 100644 --- a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp @@ -304,7 +304,7 @@ nsOutlinerBodyFrame::nsOutlinerBodyFrame(nsIPresShell* aPresShell) :nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mImageCache(nsnull), mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mStringWidth(-1), mFocused(PR_FALSE), mColumnsDirty(PR_TRUE), mDropAllowed(PR_FALSE), mHasFixedRowCount(PR_FALSE), - mVerticalOverflow(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull), mOpenTimerRow(-1) + mVerticalOverflow(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull) { NS_NewISupportsArray(getter_AddRefs(mScratchArray)); } @@ -2990,7 +2990,6 @@ nsOutlinerBodyFrame::OnDragExit(nsIDOMEvent* aEvent) if (mOpenTimer) { mOpenTimer->Cancel(); mOpenTimer = nsnull; - mOpenTimerRow = -1; } return NS_OK; @@ -3032,11 +3031,10 @@ nsOutlinerBodyFrame::OnDragOver(nsIDOMEvent* aEvent) InvalidatePrimaryCell(mDropRow); } - if (mOpenTimer && newRow != mOpenTimerRow) { + if (mOpenTimer) { // timer is active but for a different row than the current one - kill it mOpenTimer->Cancel(); mOpenTimer = nsnull; - mOpenTimerRow = -1; } // cache the new row and orientation regardless so we can check if it changed @@ -3046,7 +3044,7 @@ nsOutlinerBodyFrame::OnDragOver(nsIDOMEvent* aEvent) mDropAllowed = PR_FALSE; if (mDropRow >= 0) { - if (!mOpenTimer) { + if (!mOpenTimer && mDropOrient == nsIOutlinerView::inDropOn) { // either there wasn't a timer running or it was just killed above. // if over a folder, start up a timer to open the folder. PRBool isContainer = PR_FALSE; @@ -3056,7 +3054,6 @@ nsOutlinerBodyFrame::OnDragOver(nsIDOMEvent* aEvent) mView->IsContainerOpen(mDropRow, &isOpen); if (!isOpen) { // this node isn't expanded - set a timer to expand it - mOpenTimerRow = mDropRow; mOpenTimer = do_CreateInstance("@mozilla.org/timer;1"); mOpenTimer->Init(this, 1000, NS_PRIORITY_HIGHEST); } @@ -3287,9 +3284,7 @@ nsOutlinerBodyFrame::Notify(nsITimer* aTimer) // open the node mOpenTimer->Cancel(); mOpenTimer = nsnull; - if (mOpenTimerRow >= 0) { - mView->ToggleOpenState(mOpenTimerRow); - mOpenTimerRow = -1; - } + if (mDropRow >= 0) + mView->ToggleOpenState(mDropRow); } } diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 53c42613847..f76b0b7a3bb 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -304,7 +304,7 @@ nsOutlinerBodyFrame::nsOutlinerBodyFrame(nsIPresShell* aPresShell) :nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mImageCache(nsnull), mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mStringWidth(-1), mFocused(PR_FALSE), mColumnsDirty(PR_TRUE), mDropAllowed(PR_FALSE), mHasFixedRowCount(PR_FALSE), - mVerticalOverflow(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull), mOpenTimerRow(-1) + mVerticalOverflow(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull) { NS_NewISupportsArray(getter_AddRefs(mScratchArray)); } @@ -2990,7 +2990,6 @@ nsOutlinerBodyFrame::OnDragExit(nsIDOMEvent* aEvent) if (mOpenTimer) { mOpenTimer->Cancel(); mOpenTimer = nsnull; - mOpenTimerRow = -1; } return NS_OK; @@ -3032,11 +3031,10 @@ nsOutlinerBodyFrame::OnDragOver(nsIDOMEvent* aEvent) InvalidatePrimaryCell(mDropRow); } - if (mOpenTimer && newRow != mOpenTimerRow) { + if (mOpenTimer) { // timer is active but for a different row than the current one - kill it mOpenTimer->Cancel(); mOpenTimer = nsnull; - mOpenTimerRow = -1; } // cache the new row and orientation regardless so we can check if it changed @@ -3046,7 +3044,7 @@ nsOutlinerBodyFrame::OnDragOver(nsIDOMEvent* aEvent) mDropAllowed = PR_FALSE; if (mDropRow >= 0) { - if (!mOpenTimer) { + if (!mOpenTimer && mDropOrient == nsIOutlinerView::inDropOn) { // either there wasn't a timer running or it was just killed above. // if over a folder, start up a timer to open the folder. PRBool isContainer = PR_FALSE; @@ -3056,7 +3054,6 @@ nsOutlinerBodyFrame::OnDragOver(nsIDOMEvent* aEvent) mView->IsContainerOpen(mDropRow, &isOpen); if (!isOpen) { // this node isn't expanded - set a timer to expand it - mOpenTimerRow = mDropRow; mOpenTimer = do_CreateInstance("@mozilla.org/timer;1"); mOpenTimer->Init(this, 1000, NS_PRIORITY_HIGHEST); } @@ -3287,9 +3284,7 @@ nsOutlinerBodyFrame::Notify(nsITimer* aTimer) // open the node mOpenTimer->Cancel(); mOpenTimer = nsnull; - if (mOpenTimerRow >= 0) { - mView->ToggleOpenState(mOpenTimerRow); - mOpenTimerRow = -1; - } + if (mDropRow >= 0) + mView->ToggleOpenState(mDropRow); } }