mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 08:53:06 +08:00
Make default background color transparent in wxOSX
This is needed for translucency effects, desktop background images changing the toplevel window background tint. Also don't erase background when no background color is specified. Closes #26301.
This commit is contained in:
committed by
Vadim Zeitlin
parent
68cef639a5
commit
565553ee98
@@ -133,6 +133,14 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const override
|
||||
{
|
||||
return GetClassDefaultAttributes(GetWindowVariant());
|
||||
}
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
|
||||
+13
-1
@@ -1538,6 +1538,17 @@ wxWindowMac::AlwaysShowScrollbars(bool hflag, bool vflag)
|
||||
DoUpdateScrollbarVisibility();
|
||||
}
|
||||
|
||||
/* static */ wxVisualAttributes
|
||||
wxWindowMac::GetClassDefaultAttributes(wxWindowVariant variant)
|
||||
{
|
||||
// it is important to return valid values for all attributes from here,
|
||||
// GetXXX() below rely on this
|
||||
wxVisualAttributes attrs = wxWindowBase::GetClassDefaultAttributes(variant);
|
||||
attrs.colBg = wxTransparentColour;
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
||||
//
|
||||
// we draw borders and grow boxes, are already set up and clipped in the current port / cgContextRef
|
||||
// our own window origin is at leftOrigin/rightOrigin
|
||||
@@ -2002,9 +2013,10 @@ bool wxWindowMac::MacDoRedraw( long time )
|
||||
eevent.SetEventObject( this );
|
||||
if ( ProcessWindowEvent( eevent ) )
|
||||
break;
|
||||
|
||||
#ifdef __WXOSX_IPHONE__
|
||||
if (!UseBgCol())
|
||||
dc.Clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( UseBgCol() )
|
||||
|
||||
Reference in New Issue
Block a user