зеркало из https://github.com/mozilla/pjs.git
Making sure the left and right arrow navigation only fires when the menu bar
is active.
This commit is contained in:
Родитель
53c8309019
Коммит
013af7626e
|
@ -149,7 +149,7 @@ nsMenuBarListener::MouseMove(nsIDOMEvent* aMouseEvent)
|
|||
if (tag && (tag.get() == nsXULAtoms::xpmenu)) {
|
||||
// We found a menu.
|
||||
mMenuBarFrame->SetCurrentMenuItem(current);
|
||||
break;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Get our parent.
|
||||
|
@ -253,7 +253,8 @@ nsMenuBarListener::KeyDown(nsIDOMEvent* aKeyEvent)
|
|||
theChar == NS_VK_DOWN) {
|
||||
// The arrow keys were pressed. User is moving around within
|
||||
// the menus.
|
||||
mMenuBarFrame->KeyboardNavigation(theChar);
|
||||
if (mMenuBarFrame->IsActive())
|
||||
mMenuBarFrame->KeyboardNavigation(theChar);
|
||||
}
|
||||
|
||||
if (mMenuBarFrame->IsActive())
|
||||
|
|
|
@ -112,3 +112,12 @@ nsMenuFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
mPopupFrames.DeleteFrames(aPresContext);
|
||||
return nsAreaFrame::DeleteFrame(aPresContext);
|
||||
}
|
||||
|
||||
// Called to prevent events from going to anything inside the menu.
|
||||
NS_IMETHODIMP
|
||||
nsMenuFrame::GetFrameForPoint(const nsPoint& aPoint,
|
||||
nsIFrame** aFrame)
|
||||
{
|
||||
*aFrame = this; // Capture all events so that we can perform selection
|
||||
return NS_OK;
|
||||
}
|
|
@ -50,6 +50,10 @@ public:
|
|||
nsIAtom** aListName) const;
|
||||
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
|
||||
|
||||
// Overridden to prevent events from ever going to children of the menu.
|
||||
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
protected:
|
||||
nsFrameList mPopupFrames;
|
||||
}; // class nsMenuFrame
|
||||
|
|
Загрузка…
Ссылка в новой задаче