mirror of
https://github.com/audacity/wxWidgets.git
synced 2026-02-03 19:47:17 -06:00
Bug 2406 - Mac: (Catalina) No transparency in docking-icon.
Backported upstream fix for: https://trac.wxwidgets.org/ticket/18257
This commit is contained in:
parent
e24f7514be
commit
191f724631
@ -739,12 +739,6 @@ long style, long extraStyle, const wxString& WXUNUSED(name) )
|
||||
|
||||
[m_macWindow setDelegate:controller];
|
||||
|
||||
if ( ( style & wxFRAME_SHAPED) )
|
||||
{
|
||||
[m_macWindow setOpaque:NO];
|
||||
[m_macWindow setAlphaValue:1.0];
|
||||
}
|
||||
|
||||
if ( !(style & wxFRAME_TOOL_WINDOW) )
|
||||
[m_macWindow setHidesOnDeactivate:NO];
|
||||
}
|
||||
|
||||
@ -4984,7 +4984,15 @@ void wxWidgetCocoaImpl::SetBackgroundColour( const wxColour &col )
|
||||
|
||||
if ( [targetView respondsToSelector:@selector(setBackgroundColor:) ] )
|
||||
{
|
||||
[targetView setBackgroundColor: col.OSXGetNSColor()];
|
||||
wxWindow* peer = GetWXPeer();
|
||||
if ( peer->GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT )
|
||||
{
|
||||
wxTopLevelWindow* toplevel = wxDynamicCast(peer,wxTopLevelWindow);
|
||||
|
||||
if ( toplevel == NULL || toplevel->GetShape().IsEmpty() )
|
||||
[targetView setBackgroundColor:
|
||||
col.IsOk() ? col.OSXGetNSColor() : nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4995,6 +5003,9 @@ bool wxWidgetCocoaImpl::SetBackgroundStyle( wxBackgroundStyle style )
|
||||
if ( [m_osxView respondsToSelector:@selector(setOpaque:) ] )
|
||||
{
|
||||
[m_osxView setOpaque: opaque];
|
||||
|
||||
if ( style == wxBG_STYLE_TRANSPARENT )
|
||||
[m_osxView setBackgroundColor:[NSColor clearColor]];
|
||||
}
|
||||
|
||||
return true ;
|
||||
|
||||
@ -256,7 +256,10 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c )
|
||||
if ( !wxWindow::SetBackgroundColour(c) && m_hasBgCol )
|
||||
return false ;
|
||||
|
||||
if ( GetBackgroundStyle() != wxBG_STYLE_CUSTOM )
|
||||
// only set the native background color if the toplevel window's
|
||||
// background is not supposed to be transparent, otherwise the
|
||||
// transparency is lost
|
||||
if ( GetBackgroundStyle() != wxBG_STYLE_PAINT && GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT)
|
||||
{
|
||||
if ( m_nowpeer )
|
||||
return m_nowpeer->SetBackgroundColour(c);
|
||||
@ -511,6 +514,10 @@ bool wxNonOwnedWindow::DoSetRegionShape(const wxRegion& region)
|
||||
{
|
||||
m_shape = region;
|
||||
|
||||
// set the native content view to transparency, this is an implementation detail
|
||||
// no reflected in the wx BackgroundStyle
|
||||
GetPeer()->SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
|
||||
|
||||
return m_nowpeer->SetShape(region);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user