mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Don't highlight toplevel menus on hover for gtk. Bug 233242, r=pch, sr=roc.
This commit is contained in:
parent
2081246472
commit
64209ceda0
@ -53,6 +53,8 @@
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsTransform2D.h"
|
||||
#include "nsIMenuFrame.h"
|
||||
#include "nsIMenuParent.h"
|
||||
#include "prlink.h"
|
||||
|
||||
#include <gdk/gdkprivate.h>
|
||||
@ -274,9 +276,30 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
// menu item state is determined by the attribute "_moz-menuactive",
|
||||
// and not by the mouse hovering (accessibility).
|
||||
// and not by the mouse hovering (accessibility). as a special case,
|
||||
// menus which are children of a menu bar are only marked as prelight
|
||||
// if they are open, not on normal hover.
|
||||
|
||||
if (aWidgetType == NS_THEME_MENUITEM) {
|
||||
aState->inHover = CheckBooleanAttr(aFrame, mMenuActiveAtom);
|
||||
PRBool isTopLevel = PR_FALSE;
|
||||
nsIMenuFrame *menuFrame;
|
||||
CallQueryInterface(aFrame, &menuFrame);
|
||||
|
||||
if (menuFrame) {
|
||||
nsIMenuParent *menuParent;
|
||||
menuFrame->GetMenuParent(&menuParent);
|
||||
if (menuParent)
|
||||
menuParent->IsMenuBar(isTopLevel);
|
||||
}
|
||||
|
||||
if (isTopLevel) {
|
||||
PRBool isOpen;
|
||||
menuFrame->MenuIsOpen(isOpen);
|
||||
aState->inHover = isOpen;
|
||||
} else {
|
||||
aState->inHover = CheckBooleanAttr(aFrame, mMenuActiveAtom);
|
||||
}
|
||||
|
||||
aState->active = FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,8 @@ ifdef MOZ_XUL
|
||||
DIRS = tree grid
|
||||
endif
|
||||
|
||||
EXPORTS = nsIMenuParent.h
|
||||
|
||||
CPPSRCS = \
|
||||
nsScrollBoxFrame.cpp \
|
||||
nsRootBoxFrame.cpp \
|
||||
|
Loading…
Reference in New Issue
Block a user