fix transparency problems on macOS
under mojave any backgroundColor destroys transparency
This commit is contained in:
@@ -914,7 +914,12 @@ bool wxNonOwnedWindowCocoaImpl::SetTransparent(wxByte alpha)
|
|||||||
|
|
||||||
bool wxNonOwnedWindowCocoaImpl::SetBackgroundColour(const wxColour& col )
|
bool wxNonOwnedWindowCocoaImpl::SetBackgroundColour(const wxColour& col )
|
||||||
{
|
{
|
||||||
[m_macWindow setBackgroundColor:col.OSXGetNSColor()];
|
// only set the native background color if the toplevel window's
|
||||||
|
// background is not supposed to be transparent, otherwise the
|
||||||
|
// transparency is lost
|
||||||
|
if( GetWXPeer()->GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT &&
|
||||||
|
!(GetWXPeer()->GetWindowStyle() & wxFRAME_SHAPED) )
|
||||||
|
[m_macWindow setBackgroundColor:col.OSXGetNSColor()];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -152,8 +152,7 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
|
|||||||
wxWindowCreateEvent event(this);
|
wxWindowCreateEvent event(this);
|
||||||
HandleWindowEvent(event);
|
HandleWindowEvent(event);
|
||||||
|
|
||||||
if ( GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT )
|
SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ));
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ));
|
|
||||||
|
|
||||||
if ( parent )
|
if ( parent )
|
||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
|
Reference in New Issue
Block a user