mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 889085 - Make our sheets semi-transparent. r=mstange.
This commit is contained in:
parent
9703b89906
commit
579105656d
@ -71,6 +71,7 @@ protected:
|
||||
nsIFrame* SeparatorResponsibility(nsIFrame* aBefore, nsIFrame* aAfter);
|
||||
CGRect SeparatorAdjustedRect(CGRect aRect, nsIFrame* aLeft,
|
||||
nsIFrame* aCurrent, nsIFrame* aRight);
|
||||
bool IsWindowSheet(nsIFrame* aFrame);
|
||||
|
||||
// HITheme drawing routines
|
||||
void DrawFrame(CGContextRef context, HIThemeFrameKind inKind,
|
||||
|
@ -2100,7 +2100,14 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
|
||||
|
||||
switch (aWidgetType) {
|
||||
case NS_THEME_DIALOG: {
|
||||
HIThemeSetFill(kThemeBrushDialogBackgroundActive, NULL, cgContext, HITHEME_ORIENTATION);
|
||||
CGContextClearRect(cgContext, macRect);
|
||||
if (IsWindowSheet(aFrame)) {
|
||||
HIThemeSetFill(kThemeBrushSheetBackgroundTransparent, NULL, cgContext, HITHEME_ORIENTATION);
|
||||
}
|
||||
else {
|
||||
HIThemeSetFill(kThemeBrushDialogBackgroundActive, NULL, cgContext, HITHEME_ORIENTATION);
|
||||
}
|
||||
|
||||
CGContextFillRect(cgContext, macRect);
|
||||
}
|
||||
break;
|
||||
@ -3355,6 +3362,20 @@ nsNativeThemeCocoa::WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsNativeThemeCocoa::IsWindowSheet(nsIFrame* aFrame)
|
||||
{
|
||||
NSWindow* win = NativeWindowForFrame(aFrame);
|
||||
id winDelegate = [win delegate];
|
||||
nsIWidget* widget = [(WindowDelegate *)winDelegate geckoWidget];
|
||||
if (!widget) {
|
||||
return false;
|
||||
}
|
||||
nsWindowType windowType;
|
||||
widget->GetWindowType(windowType);
|
||||
return (windowType == eWindowType_sheet);
|
||||
}
|
||||
|
||||
nsITheme::Transparency
|
||||
nsNativeThemeCocoa::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
|
||||
{
|
||||
@ -3363,6 +3384,9 @@ nsNativeThemeCocoa::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
|
||||
case NS_THEME_TOOLTIP:
|
||||
return eTransparent;
|
||||
|
||||
case NS_THEME_DIALOG:
|
||||
return IsWindowSheet(aFrame) ? eTransparent : eOpaque;
|
||||
|
||||
case NS_THEME_SCROLLBAR_SMALL:
|
||||
case NS_THEME_SCROLLBAR:
|
||||
return nsLookAndFeel::UseOverlayScrollbars() ? eTransparent : eOpaque;
|
||||
|
Loading…
Reference in New Issue
Block a user