backport of better drawing for toggle buttons
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@64084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -472,15 +472,21 @@ void wxToolBarTool::UpdateToggleImage( bool toggle )
|
||||
#ifdef __WXMAC_OSX__
|
||||
if ( toggle )
|
||||
{
|
||||
int w = m_bmpNormal.GetWidth();
|
||||
int h = m_bmpNormal.GetHeight();
|
||||
int w = m_bmpNormal.GetWidth() + 6;
|
||||
int h = m_bmpNormal.GetHeight() + 6;
|
||||
wxBitmap bmp( w, h );
|
||||
wxMemoryDC dc;
|
||||
|
||||
dc.SelectObject( bmp );
|
||||
dc.SetPen( wxPen(*wxBLACK) );
|
||||
dc.SetBrush( wxBrush( *wxLIGHT_GREY ));
|
||||
dc.DrawRectangle( 0, 0, w, h );
|
||||
wxColour mid_grey_75 = wxColour(128, 128, 128, 196);
|
||||
wxColour light_grey_75 = wxColour(196, 196, 196, 196);
|
||||
dc.GradientFillLinear( wxRect(1, 1, w - 1, h-1),
|
||||
light_grey_75, mid_grey_75, wxNORTH);
|
||||
wxColour black_50 = wxColour(0, 0, 0, 127);
|
||||
dc.SetPen( wxPen(black_50) );
|
||||
dc.DrawRoundedRectangle( 0, 0, w, h, 1.5 );
|
||||
dc.DrawBitmap( m_bmpNormal, 3, 3, true );
|
||||
|
||||
dc.DrawBitmap( m_bmpNormal, 0, 0, true );
|
||||
dc.SelectObject( wxNullBitmap );
|
||||
ControlButtonContentInfo info;
|
||||
|
Reference in New Issue
Block a user