Supporting newer transparent background API
This commit is contained in:
@@ -91,6 +91,7 @@ public:
|
||||
virtual bool SetForegroundColour( const wxColour &colour ) wxOVERRIDE;
|
||||
|
||||
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
|
||||
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE;
|
||||
|
||||
virtual int GetCharHeight() const wxOVERRIDE;
|
||||
virtual int GetCharWidth() const wxOVERRIDE;
|
||||
|
@@ -778,6 +778,13 @@ long style, long extraStyle, const wxString& WXUNUSED(name) )
|
||||
|
||||
if ( !(style & wxFRAME_TOOL_WINDOW) )
|
||||
[m_macWindow setHidesOnDeactivate:NO];
|
||||
|
||||
if ( GetWXPeer()->GetBackgroundStyle() == wxBG_STYLE_TRANSPARENT )
|
||||
{
|
||||
[m_macWindow setOpaque:NO];
|
||||
[m_macWindow setAlphaValue:1.0];
|
||||
[m_macWindow setBackgroundColor:[NSColor clearColor]];
|
||||
}
|
||||
}
|
||||
|
||||
void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), WXWindow nativeWindow )
|
||||
|
@@ -152,7 +152,8 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
|
||||
wxWindowCreateEvent event(this);
|
||||
HandleWindowEvent(event);
|
||||
|
||||
SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ));
|
||||
if ( GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT )
|
||||
SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ));
|
||||
|
||||
if ( parent )
|
||||
parent->AddChild(this);
|
||||
|
@@ -518,6 +518,11 @@ bool wxWindowMac::SetBackgroundStyle(wxBackgroundStyle style)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxWindowMac::IsTransparentBackgroundSupported(wxString* WXUNUSED(reason)) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxWindowMac::SetBackgroundColour(const wxColour& col )
|
||||
{
|
||||
if (m_growBox)
|
||||
|
Reference in New Issue
Block a user