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.
| ... | ... | @@ -133,6 +133,14 @@ public: |
| 133 | 133 | |
| 134 | 134 | #endif
|
| 135 | 135 | |
| 136 | + virtual wxVisualAttributes GetDefaultAttributes() const override
|
|
| 137 | + {
|
|
| 138 | + return GetClassDefaultAttributes(GetWindowVariant());
|
|
| 139 | + }
|
|
| 140 | + |
|
| 141 | + static wxVisualAttributes
|
|
| 142 | + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
| 143 | + |
|
| 136 | 144 | // implementation from now on
|
| 137 | 145 | // --------------------------
|
| 138 | 146 |
| ... | ... | @@ -1538,6 +1538,17 @@ wxWindowMac::AlwaysShowScrollbars(bool hflag, bool vflag) |
| 1538 | 1538 | DoUpdateScrollbarVisibility();
|
| 1539 | 1539 | }
|
| 1540 | 1540 | |
| 1541 | +/* static */ wxVisualAttributes
|
|
| 1542 | +wxWindowMac::GetClassDefaultAttributes(wxWindowVariant variant)
|
|
| 1543 | +{
|
|
| 1544 | + // it is important to return valid values for all attributes from here,
|
|
| 1545 | + // GetXXX() below rely on this
|
|
| 1546 | + wxVisualAttributes attrs = wxWindowBase::GetClassDefaultAttributes(variant);
|
|
| 1547 | + attrs.colBg = wxTransparentColour;
|
|
| 1548 | + |
|
| 1549 | + return attrs;
|
|
| 1550 | +}
|
|
| 1551 | + |
|
| 1541 | 1552 | //
|
| 1542 | 1553 | // we draw borders and grow boxes, are already set up and clipped in the current port / cgContextRef
|
| 1543 | 1554 | // our own window origin is at leftOrigin/rightOrigin
|
| ... | ... | @@ -2002,9 +2013,10 @@ bool wxWindowMac::MacDoRedraw( long time ) |
| 2002 | 2013 | eevent.SetEventObject( this );
|
| 2003 | 2014 | if ( ProcessWindowEvent( eevent ) )
|
| 2004 | 2015 | break;
|
| 2005 | - |
|
| 2016 | +#ifdef __WXOSX_IPHONE__
|
|
| 2006 | 2017 | if (!UseBgCol())
|
| 2007 | 2018 | dc.Clear();
|
| 2019 | +#endif
|
|
| 2008 | 2020 | }
|
| 2009 | 2021 | |
| 2010 | 2022 | if ( UseBgCol() )
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help