Bug 469683 - Wrong context menu transparency, r=josh sr=roc

This commit is contained in:
Markus Stange 2008-12-15 21:27:30 +01:00
Родитель 2990d4d350
Коммит 0976ba4536
2 изменённых файлов: 3 добавлений и 7 удалений

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

@ -85,8 +85,6 @@ extern BOOL gSomeMenuBarPainted;
#define NS_APPSHELLSERVICE_CONTRACTID "@mozilla.org/appshell/appShellService;1"
#define POPUP_DEFAULT_TRANSPARENCY 0.95
NS_IMPL_ISUPPORTS_INHERITED1(nsCocoaWindow, Inherited, nsPIWidgetCocoa)
@ -359,7 +357,6 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent,
backing:NSBackingStoreBuffered defer:YES];
if (mWindowType == eWindowType_popup) {
[mWindow setAlphaValue:POPUP_DEFAULT_TRANSPARENCY];
[mWindow setLevel:NSPopUpMenuWindowLevel];
[mWindow setHasShadow:YES];
@ -790,10 +787,6 @@ void nsCocoaWindow::MakeBackgroundTransparent(PRBool aTransparent)
BOOL currentTransparency = ![mWindow isOpaque];
if (aTransparent != currentTransparency) {
// Popups have an alpha value we need to toggle.
if (mWindowType == eWindowType_popup) {
[mWindow setAlphaValue:(aTransparent ? 1.0 : POPUP_DEFAULT_TRANSPARENCY)];
}
[mWindow setOpaque:!aTransparent];
[mWindow setBackgroundColor:(aTransparent ? [NSColor clearColor] : [NSColor whiteColor])];
}

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

@ -1453,6 +1453,9 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
break;
case NS_THEME_MENUITEM: {
// Clear the background to get correct transparency.
CGContextClearRect(cgContext, macRect);
// maybe use kThemeMenuItemHierBackground or PopUpBackground instead of just Plain?
HIThemeMenuItemDrawInfo drawInfo = {
version: 0,