зеркало из https://github.com/mozilla/pjs.git
Fixing more keyboard navigation glitches in XP menus.
This commit is contained in:
Родитель
b717ae2247
Коммит
8dcfbf153d
|
@ -243,8 +243,12 @@ nsMenuFrame::HandleEvent(nsIPresContext& aPresContext,
|
||||||
if (isActive) cancel = PR_FALSE;
|
if (isActive) cancel = PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cancel)
|
if (cancel) {
|
||||||
mMenuParent->SetCurrentMenuItem(nsnull);
|
if (IsMenu() && !isMenuBar && mMenuOpen) {
|
||||||
|
// Submenus don't get closed up.
|
||||||
|
}
|
||||||
|
else mMenuParent->SetCurrentMenuItem(nsnull);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aEvent->message == NS_MOUSE_MOVE && mMenuParent) {
|
else if (aEvent->message == NS_MOUSE_MOVE && mMenuParent) {
|
||||||
|
@ -480,6 +484,7 @@ void
|
||||||
nsMenuFrame::Notify(nsITimer* aTimer)
|
nsMenuFrame::Notify(nsITimer* aTimer)
|
||||||
{
|
{
|
||||||
// Our timer has fired.
|
// Our timer has fired.
|
||||||
|
if (aTimer == mOpenTimer.get()) {
|
||||||
if (!mMenuOpen && mMenuParent) {
|
if (!mMenuOpen && mMenuParent) {
|
||||||
nsAutoString active = "";
|
nsAutoString active = "";
|
||||||
mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, active);
|
mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, active);
|
||||||
|
@ -488,6 +493,10 @@ nsMenuFrame::Notify(nsITimer* aTimer)
|
||||||
OpenMenu(PR_TRUE);
|
OpenMenu(PR_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mOpenTimer->Cancel();
|
||||||
|
mOpenTimer = nsnull;
|
||||||
|
}
|
||||||
|
|
||||||
mOpenTimer = nsnull;
|
mOpenTimer = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -486,12 +486,17 @@ nsMenuPopupFrame::KeyboardNavigation(PRUint32 aDirection, PRBool& aHandledFlag)
|
||||||
|
|
||||||
aHandledFlag = PR_TRUE;
|
aHandledFlag = PR_TRUE;
|
||||||
}
|
}
|
||||||
else if (aDirection == NS_VK_LEFT && mCurrentMenu &&
|
else if (mCurrentMenu && menuFrame->IsMenu() && menuFrame->IsOpen()) {
|
||||||
menuFrame->IsMenu()) {
|
|
||||||
// Close it up.
|
|
||||||
aHandledFlag = PR_TRUE;
|
aHandledFlag = PR_TRUE;
|
||||||
|
if (aDirection == NS_VK_LEFT) {
|
||||||
|
// Close it up.
|
||||||
menuFrame->OpenMenu(PR_FALSE);
|
menuFrame->OpenMenu(PR_FALSE);
|
||||||
}
|
}
|
||||||
|
else if (aDirection == NS_VK_RIGHT) {
|
||||||
|
// Select the first item.
|
||||||
|
menuFrame->SelectFirstItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
Загрузка…
Ссылка в новой задаче