зеркало из https://github.com/mozilla/gecko-dev.git
Making sure the first menu item gets selected as you keyboard navigate into new
menus.
This commit is contained in:
Родитель
ea91269dfa
Коммит
58fee918ef
|
@ -238,6 +238,13 @@ nsMenuBarFrame::KeyboardNavigation(PRUint32 aDirection)
|
|||
else GetPreviousMenuItem(mCurrentMenu, &nextItem);
|
||||
|
||||
SetCurrentMenuItem(nextItem);
|
||||
if (nextItem) {
|
||||
nsMenuFrame* menu = (nsMenuFrame*)nextItem;
|
||||
if (menu->IsOpen()) {
|
||||
// Select the first item.
|
||||
menu->SelectFirstItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (aDirection == NS_VK_UP || aDirection == NS_VK_DOWN) {
|
||||
// Open the menu and select its first item.
|
||||
|
|
|
@ -373,5 +373,11 @@ nsMenuFrame::Escape(PRBool& aHandledFlag)
|
|||
void
|
||||
nsMenuFrame::SelectFirstItem()
|
||||
{
|
||||
//XXX Fill in!
|
||||
nsIFrame* frame = mPopupFrames.FirstChild();
|
||||
if (frame) {
|
||||
nsMenuPopupFrame* popup = (nsMenuPopupFrame*)frame;
|
||||
nsIFrame* result;
|
||||
popup->GetNextMenuItem(nsnull, &result);
|
||||
popup->SetCurrentMenuItem(result);
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче