Bug 319532 [gnome]There is no feedback when use keyboard to navigate

disabled menuitem in Mozilla menu
r+sr=roc
This commit is contained in:
ginn.chen%sun.com 2006-03-17 03:55:10 +00:00
Родитель 3f1406a60e
Коммит 7b6775a4c7
5 изменённых файлов: 20 добавлений и 3 удалений

Просмотреть файл

@ -1927,10 +1927,19 @@ PRBool
nsMenuPopupFrame::IsValidItem(nsIContent* aContent)
{
nsIAtom *tag = aContent->Tag();
PRBool skipNavigatingDisabledMenuItem;
GetPresContext()->LookAndFeel()->
GetMetric(nsILookAndFeel::eMetric_SkipNavigatingDisabledMenuItem,
skipNavigatingDisabledMenuItem);
return (tag == nsXULAtoms::menu ||
tag == nsXULAtoms::menuitem ||
tag == nsHTMLAtoms::option);
PRBool result = (tag == nsXULAtoms::menu ||
tag == nsXULAtoms::menuitem ||
tag == nsHTMLAtoms::option);
if (skipNavigatingDisabledMenuItem)
result = result && !IsDisabled(aContent);
return result;
}
PRBool

Просмотреть файл

@ -184,6 +184,7 @@ public:
eMetric_SelectTextfieldsOnKeyFocus, // select textfields when focused via tab/accesskey?
eMetric_SubmenuDelay, // delay before submenus open
eMetric_MenusCanOverlapOSBar, // can popups overlap menu/task bar?
eMetric_SkipNavigatingDisabledMenuItem, // skip navigating to disabled menu item?
eMetric_DragFullWindow, // show window contents while dragging?
eMetric_DragThresholdX, // begin a drag if the mouse is moved further than the threshold while the button is down
eMetric_DragThresholdY,

Просмотреть файл

@ -387,6 +387,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
// we want XUL popups to be able to overlap the task bar.
aMetric = 1;
break;
case eMetric_SkipNavigatingDisabledMenuItem:
aMetric = 1;
break;
case eMetric_DragFullWindow:
aMetric = 1;
break;

Просмотреть файл

@ -421,6 +421,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
// we want XUL popups to be able to overlap the task bar.
aMetric = 1;
break;
case eMetric_SkipNavigatingDisabledMenuItem:
aMetric = 1;
break;
case eMetric_DragFullWindow:
aMetric = 1;
break;

Просмотреть файл

@ -93,6 +93,7 @@ nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs[] =
{ "ui.isScreenReaderActive", eMetric_IsScreenReaderActive, PR_FALSE, nsLookAndFeelTypeInt, 0 },
{ "ui.menusCanOverlapOSBar", eMetric_MenusCanOverlapOSBar,
PR_FALSE, nsLookAndFeelTypeInt, 0 },
{ "ui.skipNavigatingDisabledMenuItem", eMetric_SkipNavigatingDisabledMenuItem, PR_FALSE, nsLookAndFeelTypeInt, 0 },
{ "ui.treeOpenDelay",
eMetric_TreeOpenDelay, PR_FALSE, nsLookAndFeelTypeInt, 0 },
{ "ui.treeCloseDelay",